Mongo docs talk about queries yielding locks to avoid blocking other operations. Will Mongo yield the lock from a read to a write that changes the read result?
Say I've got docs {x:1}, {x:2}, {x:2}, {x:1}
and I'm reading find({x:2})
. Assume the fourth doc isn't in the working set, so Mongo page faults, yielding the lock to an update({x:1}, {x:2}, {multi: true})
, which completes and returns the lock to the find
. The find would now include the fourth doc but omit the first doc. Does Monogo work like this?