I realize that the findOneAndUpdate ensures an atomic operation, so
I'm assuming that updateOne does not.
Why are you assuming that ?
findOneAndUpdate
returns a document, updateOne
doesn't (it just returns the id if it has created a new document). I think that's the main difference. So the use case of updateOne
is when you don't need the document and want to save a bit of time and bandwidth.