How to do CRUD operation on Couchbasebase Synchgateway by using NODE js REST API?

Hi,

I am doing an applicaiton for mobile and web. So im doing Couchbase synchgate way to synch data from server to my mobile device. So i used following code do CRUD operations by using NODE JS.

var myCluster = new couchbase.Cluster(‘http://159.203.136.151:8091’);// This is the url what you given
var myBucket = myCluster.openBucket(‘default’);
ottoman.bucket=myBucket;

But by using above code. data inserting into server but not geting through couchbase server. so i changed url to following like

var myCluster = new couchbase.Cluster(‘http://159.203.136.151:4984/db/’);// This is the url what you given
var myBucket = myCluster.openBucket(‘default’);
ottoman.bucket=myBucket;

Now im getting following issue.
Error: cannot perform operations on a shutdown bucket

Please help me on this.

Don’t use the Couchbase Server APIs to write data; that bypasses Sync Gateway. Instead use the Sync Gateway REST API, which is documented on our website.

Is it possible to do with node just

Can you please share doc link

Sure, you can send HTTP requests with Node.
Just go to the mobile documentation page and look for Sync Gateway REST API docs. I have too much going on right now to look it up for you, sorry.

Hi @jens Actually i was followed that tutorial and i got some issues with CROS origin issue.

see my below post

N1QL queries aren’t part of Sync Gateway. Hopefully someone on the N1QL forum can help you with that.