We don’t have an official JavaScript API, so that updateDocument function must be from an unofficial source; your best bet would be to ask the developers of that API, maybe via an issue on their Github repo if there is one.
The JS API is ultimately sending HTTP requests to Couchbase Lite’s REST API, which is what we support. If you know the exact HTTP request that’s being sent and have an issue with it, we can answer that.
(We’d like to offer a supported JS API, but we just haven’t had the resources to do so yet.)
This is a very broad question, and it’s not clear what you’re asking. You’ll have better luck reading the docs and trying things on your own, and asking focused questions about specific problems.
I don’t know why an update would return a 406 error; normally that error only happens with a GET request, if the requested response type isn’t available. I think this problem has something to do with the Ionic wrapper code you’re using.
Whenever you update a document, you have to pass the revision ID that the document had when you retrieved it:
GET (or PUT) document
Get the revision ID from the response
Modify the document properties
PUT the change, including the revision ID from step 2.
Hi team.
i can’t update localy and in the server.
it is not pushing update to the server. Using sync gateway, CreateDocument and Delete function are working properly in my aplication and the Couchbase server sync is also working correctly through syncgateway. but while using update i see the status code 200 in the sync but any change has done localy and in the couchbase server.