–session 1:
pradb>db.t1225_2.find()
{ “_id” : ObjectId(“5a40b358f34facabd6036d27”), “f1” : “a” }
{ “_id” : ObjectId(“5a40b358f34facabd6036d28”), “f2” : “b” }
{ “_id” : ObjectId(“5a40b378f34facabd6036d29”), “f1” : “d” }
{ “_id” : ObjectId(“5a40b378f34facabd6036d2a”), “f2” : “e” }
{ “_id” : ObjectId(“5a40b378f34facabd6036d2b”), “f3” : “f” }
pradb>db.t1225_2.find().snapshot() db.t1225_2.update({f1:’a’},{$set:{f1:’A’}})
WriteResult({ “nMatched” : 1, “nUpserted” : 0, “nModified” : 1 })
pradb>db.t1225_2.find()
{ “_id” : ObjectId(“5a40b358f34facabd6036d27”), “f1” : “A” }
{ “_id” : ObjectId(“5a40b358f34facabd6036d28”), “f2” : “b” }
{ “_id” : ObjectId(“5a40b378f34facabd6036d29”), “f1” : “d” }
{ “_id” : ObjectId(“5a40b378f34facabd6036d2a”), “f2” : “e” }
{ “_id” : ObjectId(“5a40b378f34facabd6036d2b”), “f3” : “f” }
–session 1:回到会话1,发现其中的f1字段返回了新值A
pradb>db.t1225_2.find().snapshot()
{ “_id” : ObjectId(“5a40b358f34facabd6036d27”), “f1” : “A” }
{ “_id” : ObjectId(“5a40b358f34facabd6036d28”), “f2” : “b” }
{ “_id” : ObjectId(“5a40b378f34facabd6036d29”), “f1” : “d” }
{ “_id” : ObjectId(“5a40b378f34facabd6036d2a”), “f2” : “e” }
{ “_id” : ObjectId(“5a40b378f34facabd6036d2b”), “f3” : “f” }
pradb>db.t1225_2.find()
{ “_id” : ObjectId(“5a40b358f34facabd6036d27”), “f1” : “A” }
{ “_id” : ObjectId(“5a40b358f34facabd6036d28”), “f2” : “b” }
{ “_id” : ObjectId(“5a40b378f34facabd6036d29”), “f1” : “d” }
{ “_id” : ObjectId(“5a40b378f34facabd6036d2a”), “f2” : “e” }
{ “_id” : ObjectId(“5a40b378f34facabd6036d2b”), “f3” : “f” }
问题是:
为何会话1中执行db.t1225_2.find().snapshot()后没有返回旧值’a’ ?