db.collection.findAndModify({
query: <document>,
sort: <document>,
remove: <boolean>,
update: <document>,
new: <boolean>,
fields: <document>,
upsert: <boolean>,
bypassDocumentValidation: <boolean>,
writeConcern: <document>,
collation: <document>
});
如果能将这个命令变成驱动的一个方法,这样能灵活的多,比如可以使用该方法实现 mongoDb 的模拟事务等等。我的水平太差了,希望 liu21st 老大 能帮忙写一下
最佳答案
