I would like to know if Azure documentDB provides conditional write? I mean do the write operation when some condition meets.
For example, if I have several resources in DB, I want to delete a resource when at least 2 resources in the DB. It seems the the document saying to check if etag matches. But what if in a case when there are at least 3 resources in the db, user1 tries to delete one resource with etag version1, but user2 tries to add a resource and updated the etag. Then the delete operation will fail.