meteor / meteor-feature-requests

A tracker for Meteor issues that are requests for new functionality, not bugs.
Other
89 stars 3 forks source link

Support mutate-and-return operations #416

Open Torgen opened 3 years ago

Torgen commented 3 years ago

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.