The current MongoDB driver supports the operations findOneAndDelete, findOneAndReplace, and findOneAndUpdate which support modifying a document and returning the old version of the document as a single operation. Especially since Meteor doesn't allow creating a transaction yet, supporting these atomic operations would allow developers to avoid patterns like double checked read and update loops to avoid race conditions.
The current MongoDB driver supports the operations
findOneAndDelete
,findOneAndReplace
, andfindOneAndUpdate
which support modifying a document and returning the old version of the document as a single operation. Especially since Meteor doesn't allow creating a transaction yet, supporting these atomic operations would allow developers to avoid patterns like double checked read and update loops to avoid race conditions.