nModified nMatched



How can I detect number of mached and changed documents in an UPDATE statement?

Like mongodb

WriteResult. nMatched

The number of documents selected for update. If the update operation results in no change to the document, e.g. $set expression updates the value to the current value, nMatched can be greater than nModified .

WriteResult. nModified

The number of existing documents updated. If the update/replacement operation results in no change to the document, such as setting the value of the field to its current value, nModified can be less than nMatched .


In the N1QL All matched documents will have mutation. I.e. Even if SET doesn’t change it will do update and included in mutationCount. If you want avoid that you can add additional predicate. cc @keshav_m


So , How can I get nModified? for instance in nodejs sdk there is no field in response