发布于 2015-09-14 14:49:09 | 99 次阅读 | 评论: 0 | 来源: 网络整理

cursor.snapshot()

Append the cursor.snapshot() method to a cursor to toggle the “snapshot” mode. This ensures that the query will not return a document multiple times, even if intervening write operations result in a move of the document due to the growth in document size.

警告

  • You must apply cursor.snapshot() to the cursor before retrieving any documents from the database.
  • You can only use snapshot() with unsharded collections.

The snapshot() does not guarantee isolation from insertion or deletions.

The cursor.snapshot() traverses the index on the _id field. As such, snapshot() cannot be used with sort() or hint().

Queries with results of less than 1 megabyte are effectively implicitly snapshotted.

最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务