Using nativescript couchbase plugin and sync gateway to read document changes from the server


I’m working on a nativescript application using couchbase plugin and sync gateway.
I’ve been following these tutorials and they did work, but what I want to do for now is just an application that pulls the data from couchbase.

Using the previous example I can see the changes in my app when I insert something from the tutorial app, but when I insert something directly into the couchbase server it won’t read it. Even if I update or delete the documents inserted in the tutorial app, my application won’t see those changes.

Why is this happening? I have seen that when the tutorial app creates a document, couchbase server adds a _sync parameter to their JSON, but I’m still trying to figure out if that’s something relevant.

What version of Couchbase Server and Sync Gateway are you using? There is a minimum requirement for having the functionality of being able to insert directly into Couchbase Server and having things sync. You need to have Couchbase Server 5.0+ and Sync Gateway 1.5+. If you cannot use this version, you will have to put your writes through the Sync Gateway REST API in order for them to sync.

More info here

Thanks for the info.

I’m using couchbase server 5.1.1 and Sync Gateway 2.0.
After adding "import_docs": "continuous" to my JSON file , Sync Gateway recognizes when I insert a document, but if I try to update or delete a document it keeps the original data.
I also added "enable_shared_bucket_access":true , though I think it’s not necessary.

EDIT: I was speaking about manually updating/deleting the documents. It does work if I use N1QL queries.