Using multiple buckets
See original GitHub issueOttoman’s bucket is initialized through a property (which seems odd, using a function or a constructor make more sense).
var ottoman = require('ottoman');
var couchbase = require('couchbase');
var cluster = new couchbase.Cluster('couchbase://127.0.0.1');
ottoman.bucket = cluster.openBucket('default');
But, the important point here is: is there a way to change this bucket over time?
It does not seems possible to create multiple ottoman
instance, because the require('ottoman')
is a already a constructor.
Some models will lies in a specific bucket and other models in another bucket.
So, how to use multiple buckets? Is Ottoman limited to one bucket for the time being?
Thanks.
Issue Analytics
- State:
- Created 7 years ago
- Comments:13 (9 by maintainers)
Top Results From Across the Web
Using Multiple Buckets AWS Amplify - Medium
So if we want to use the Amplify modules to upload or download files from more than one bucket we start facing some...
Read more >Can I use multiple buckets? · Issue #1549 · aws-amplify ...
The Amplify Framework provides support for a single bucket for your projects. The recommended way by S3 is to add an additional sub-folder...
Read more >Multiple s3-buckets in aws amplify - Stack Overflow
I get s3-access denied error as my bucket is private. I tried to add s3fullaccess permission to the backend role that is used...
Read more >Amazon S3 Replication Adds Support for Multiple Destination ...
Amazon S3 Replication now gives you the ability to replicate data from one source bucket to multiple destination buckets. With S3 Replication ( ......
Read more >How to use s3 life cycle policy for multiple buckets those ...
I have multiple buckets those stating with name dataplatform-raw , I wanted to apply life cycle policy to transition the data to s3...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey Guys, You can create as many Ottoman instances as you desire, they just won’t be directly accessible. For convenience, the Ottoman.js module returns a already-constructed Ottoman object, but you can create more, here is an example:
P.S. Using multiple discreet Ottoman instances means that you are not able to reference between different models on different Ottoman instances. This is because the top-level Ottoman objects each maintain their own list of model data.
Cheers, Brett
@kivervinicius see my comment earlier in this thread, you need to pass the bucket to the model via a store adapter, not to the ottoman instances.