Run Queries atomically

n1ql
query

#1

I have a scenario where I need to update a document in the bucket (using upsert) and delete another document(using remove) in the same bucket.
But I want both the update and delete should be successful or neither is successful.

How to achieve this?
I am using Couchbase java SDK.


#2

Please see these. Cisco explains how they do this with Couchbase.