Counter Atomic operation


I wanted to check if a particular exists in a collection or not and create new one if not already
I am using collection.exists(counter-key).exists to check for the existence of counter
is this operation atomic in nature?


Hi @dev-agr - Operations on a single document can be considered atomic (as in the operation will either succeed or fail completely). In the case of the exist operation, the document will either exist or not exist.