You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I am looking for functionality to do mongos findOneAndUpdate (https://www.mongodb.com/docs/manual/reference/method/db.collection.findOneAndUpdate), which I need for cuncurrency reasons. Mongo's findOneAndUpdate find and updates in one step, so you don't need to worry about another thread updating data between another threads find and update.
If i understand correctly, when doing something like Object.find(...).update_one(...), the find and update are separate so other threads could mess with things if they update data between the find and update
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, I am looking for functionality to do mongos findOneAndUpdate (https://www.mongodb.com/docs/manual/reference/method/db.collection.findOneAndUpdate), which I need for cuncurrency reasons. Mongo's findOneAndUpdate find and updates in one step, so you don't need to worry about another thread updating data between another threads find and update.
If i understand correctly, when doing something like Object.find(...).update_one(...), the find and update are separate so other threads could mess with things if they update data between the find and update
Beta Was this translation helpful? Give feedback.
All reactions