As i keep track of bounced emails i need to set a bounce flag on the track_request doc. So i am wondering to cut down network traffic if i can retrieve a key in my doc and update another in a single query. I know it can be done in sql but not sure if N1QL supports something like this. As i don’t care about the updated value this might be possible.
select campaign from Contacts where _type = 'track_request' and ARRAY_CONTAINS(send_to, $1 ) and subject like $2
update Contacts set bounce = true where _type = 'track_request' and ARRAY_CONTAINS(send_to, $1 ) and subject like $2