I want to perform update on documents. I am using couchbase subdocument api to update the documents.
While performing the update,I only have the document id at hand. However to get the current Cas value I have to perform a get to the couchbase.
My update looks like:
PrimaryBucket.mutateIn(document_id).upsert("path1","updatevalue1").upsert("path2","updatevalue2")
To handle optimistic locking, i want to use "mutateIn(id).withCas(<currentcasvalue>)"
While performing the update,I only have the document id at hand. However to get the current Cas value I have to perform a get to the couchbase. Is there a way to avoid fetching the whole document in order to only get the cas value to perform the update.
Is this the correct approach?