mongodb c# API V2: Difference between ReplaceOne and FindOneAndReplace

大兔子大兔子 提交于 2019-12-13 15:26:10

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!