Problem with create document on Node.js


#1

Hi, i want to create a documents by using Node.js script.
I used following code from this link

 myBucket.insert('document_name', {some:'value'}, function(err, res) {
   console.log('Success!');
 });

Here i have query. why should i have to pass document name every time, is there any alternative to take unique id automatically.

i used coucbase lite, now i want access coucbase lite data on web browser by using Node.js script. On coubase lite, i had never gave any document name and id. all are generated automatically.


#2

Hi, Couchbase Mobile gives you a full development model on top of Couchbase Server. The SDK access are more low level. We do not have mechanism to automatically add a document name.


#3

Then i have a query. i was created a document from Couchbase Lite then its created automatically with some unique id. then now i want to update that document from Node.js

so what is the code for update the existing document by using Node.js script


#4

You should use the Sync Gateway REST API described here: http://developer.couchbase.com/documentation/mobile/1.2/develop/references/couchbase-lite/rest-api/index.html