Does Couchbase partial JSON update?

  1. Does Couchbase partial JSON update?. I mean after inserting a JSON document, can I update a field value or nested JSON without loading the full JSON?

  2. Does N1QL support UPDATE QUERY also or only SELECT QUERY?

Hey @ajaygarga,

As of right now you cannot do a “partial” update to a particular JSON document. It is a common request and it will end up in a future release.

There are a few tickets open in our issue tracker for this:

In terms of N1QL, it supports INSERT, UPDATE, UPSERT, and DELETE.


Note that in 4.0’s release, INSERT, UPDATE, UPSERT, DELETE are beta functionality. That’ll be changed in the future, of course.

Thanks for your prompt response

can you pls the link to the document for the partial json update within the document? hopefully with an example

If you are looking for N1QL query to update documents, then you need UPDATE statement.

But on the other hand all SDKs now support partial updates, you can find more about at Sub-Document Operations of the SDK documentation.

thanks, but I don’t see anything that adding details on how to update a nested array JSON sub document (not fields but an entire sub json document). All examples lead straight to a partial sub-level field update.
if you can look at my question posted here: Sub document update for a nested array document