Hello,
I think I’ve asked a similar question before, but I think I actually have a use case.
I’m calling two apis concurrently from javascript.
The two apis use the same document almost at the same time as the two apis gets called almost exactly the same time in many cases.
When I use “upsert” method, I get concurrency issue 90% of the time. However, when I use “update mybucket use keys…” n1ql query, it always works.
As far as I know, n1ql uses “cas” internally. I expected to get an exception from n1ql query, but it looks like it works 100% of the time so far.
Can I depend on n1ql when it comes to concurrency? How does n1ql handle concurrency? Does it automatically lock the document then wait if the target document is locked and then update?