<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Use snapshot mode for the query</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="mongocursor.slaveokay.html">MongoCursor::slaveOkay</a></div> <div class="next" style="text-align: right; float: right;"><a href="mongocursor.sort.html">MongoCursor::sort</a></div> <div class="up"><a href="class.mongocursor.html">MongoCursor</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="mongocursor.snapshot" class="refentry"> <div class="refnamediv"> <h1 class="refname">MongoCursor::snapshot</h1> <p class="verinfo">(PECL mongo >=0.9.4)</p><p class="refpurpose"><span class="refname">MongoCursor::snapshot</span> — <span class="dc-title">Use snapshot mode for the query</span></p> </div> <div class="refsect1 description" id="refsect1-mongocursor.snapshot-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type"><a href="class.mongocursor.html" class="type MongoCursor">MongoCursor</a></span> <span class="methodname"><strong>MongoCursor::snapshot</strong></span> ( <span class="methodparam">void</span> )</div> <p class="para rdfs-comment"> Use snapshot mode for the query. Snapshot mode assures no duplicates are returned, or objects missed, which were present at both the start and end of the query's execution (if an object is new during the query, or deleted during the query, it may or may not be returned, even with snapshot mode). </p> <p class="para"> Note that short query responses (less than 1MB) are always effectively snapshotted. </p> <p class="para"> Currently, snapshot mode may not be used with sorting or explicit hints. </p> </div> <div class="refsect1 parameters" id="refsect1-mongocursor.snapshot-parameters"> <h3 class="title">Parameters</h3> <p class="para">This function has no parameters.</p> </div> <div class="refsect1 returnvalues" id="refsect1-mongocursor.snapshot-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns this cursor. </p> </div> <div class="refsect1 errors" id="refsect1-mongocursor.snapshot-errors"> <h3 class="title">Errors/Exceptions</h3> <p class="para"> Throws <a href="class.mongocursorexception.html" class="classname">MongoCursorException</a> if this cursor has started iterating. </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="mongocursor.slaveokay.html">MongoCursor::slaveOkay</a></div> <div class="next" style="text-align: right; float: right;"><a href="mongocursor.sort.html">MongoCursor::sort</a></div> <div class="up"><a href="class.mongocursor.html">MongoCursor</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>