About couchbase server 5.0 use ottoman with node sdk latest version


#1

hi:

I just learn ottoman for few days. I think it’s like moogose of mongodb database tools.
but I already use the couchbase server beta 2 version database server. now the ottoman latest version is 1.0.4, It seem only support the node sdk 2.3.0.
my question is: can I use node sdk 2.3.0 and ottoman with the latest couchbase server beta 2 ?
If can, what will attentions?

thank you for reply.


#2

Hey @angular,

Ottoman.js utilizes a default version of the Node.js SDK by default, but it is possible to override this by passing a custom StoreAdapter to Ottoman. I’ve included an example of this below, we also intend to update Ottoman.js to support 5.0 once 5.0 is fully released.

var couchbase = require('couchbase');
var myCluster = new couchbase.Cluster('couchbase://localhost');
myCluster.authenticate('Administrator', 'password');
var myBucket = myCluster.openBucket('default');
ottoman.store = new ottoman.StoreAdapter.Couchbase(myBucket, couchbase);

Cheers, Brett


#3

thank you. I installed latest nodejs sdk (couchbase@2.4.0), but when I install ottoman,npm will get V2.2.5.and the github haven’t this version. how can I resolve it?

thank you!


#4

I install ottoman from github is OK, thank you!


#5

Hey @brett19,

I'm using ottoman with couchbase server 5.0 beta2, thank you again.
ottoman is great job with couchbase like moogonse, but I have new issue, may you help me?
I watch a ottoman lesson from youtube, the author is Nic Raboy.
this lesson let me kown ottoModel can has ref to another ottoModel,but I can't get all document from ref, code is below:



my you help me? thank you!


#6

hi @brett19
may you talk a look my queston? thank you!


#7

Hey @angular,

You may need to do load:['comments[*]'] to load the actual comments, rather than attempting to load the array (which would already have been loaded.

Cheers, Brett


#8

thank you for reply. as you reply, I rewrite my code below:


but when I get the api, it still return a ref:

Is there any problem with my method of use?
There is one more question to ask:
where can I find the ottoman sdk full manual? except http://ottomanjs.com. There is so little content
Thank you very much for your help!