问题
Looking a the mongodb documentation I read that FindOneAndReplace would be an ATOMIC operation. But what I don't understand is why ReplaceOne wouldn't be atomic? And if there is a difference why should one use ReplaceOne at all?
回答1:
I just found the answer here, which should be the same for replace.
https://docs.mongodb.org/manual/reference/method/db.collection.findAndModify/#comparisons-with-the-update-method
来源:https://stackoverflow.com/questions/36895238/mongodb-c-sharp-api-v2-difference-between-replaceone-and-findoneandreplace