Is there a way to achieve subdocument level CAS, for example the client explicitly chooses some subdocument field as CAS key?
Hi @zxcware
No, this isn’t supported. If you expect multiple agents to be updating the same field at the same time, then you’ll need to use document-level CAS.
But, you don’t need to fetch the full document just to get the CAS. You can do a collection.lookupIn
or collection.exists(docId)
call instead - it’s still a network roundtrip, but the fetched data is minimised, so you’re still preserving many of the benefits of Sub-Document.
Thank you. Is there a plan to add the support, for it sounds like a great concurrency performance bump?