Databases Reference
In-Depth Information
Figure 4-2. An enlarged document may not fit where it did before
Figure 4-3. MongoDB relocates updated documents that don't fit in their original position
Now our program continues to fetch batches of documents. When it gets toward the
end, it will return the relocated documents again ( Figure 4-4 )!
Figure 4-4. A cursor may return these relocated documents again in a later batch
The solution to this problem is to snapshot your query. If you add the "$snapshot"
option, the query will be run against an unchanging view of the collection. All queries
that return a single batch of results are effectively snapshotted. Inconsistencies arise
 
Search WWH ::




Custom Search