MongoCursor::setFlag

(PECL mongo >=1.2.11) Sets arbitrary flags in case there is no method available the specific flag public MongoCursor MongoCursor::setFlag ( int $flag [, bool $set = true ] ) The MongoCursor class has several methods for setting flags on the query object. This method is available in case the MongoDB wire protocol has acquired a new flag, and the driver has not been updated with a method for this new flag. In all other cas

MongoCursor::slaveOkay

(PECL mongo >=0.9.4) Sets whether this query can be done on a secondary [deprecated] public MongoCursor MongoCursor::slaveOkay ([ bool $okay = true ] ) Calling this will make the driver route reads to secondaries if: You are using a replica set, and You created a MongoClient instance using the option "replicaSet" => "setName", and There is a healthy secondary that can be reached by the driver. MongoCurs

MongoCursor::reset

(PECL mongo >=0.9.0) Clears the cursor public void MongoCursor::reset ( void ) Returns: NULL.

MongoCursor::next

(PECL mongo >=0.9.0) Advances the cursor to the next result, and returns that result public array MongoCursor::next ( void ) Returns: Returns the next document. Exception: Throws MongoConnectionException if it cannot reach the database and MongoCursorTimeoutException if the timeout is exceeded. See also:

MongoCursor::key

(PECL mongo >=0.9.0) Returns the current result's _id, or its index within the result set public string|int MongoCursor::key ( void ) Returns: The current result's _id as a string. If the result has no _id, its numeric index within the result set will be returned as an integer. See also: Iterator::key() -

MongoCursor::maxTimeMS

(PECL mongo >=1.5.0) Sets a server-side timeout for this query public MongoCursor MongoCursor::maxTimeMS ( int $ms ) Specifies a cumulative time limit in milliseconds to be allowed by the server for processing operations on the cursor. Parameters: ms Specifies a cumulative time limit in milliseconds to be allowed by the server for processing operations on the cursor.

MongoCursor::rewind

(PECL mongo >=0.9.0) Returns the cursor to the beginning of the result set public void MongoCursor::rewind ( void ) This is identical to the function: <?php public function rewind() {     $this->reset();     $this->next(); } ?> Returns: NULL. Exception: Throws MongoConnectionException if it cannot reach the database and MongoCursorTimeoutExc

MongoCursor::partial

(PECL mongo >=1.2.0) If this query should fetch partial results from mongos if a shard is down public MongoCursor MongoCursor::partial ([ bool $okay = true ] ) This option allows mongos to send partial query results if a shard is unreachable. This is only applicable when running a sharded MongoDB cluster and connecting to a mongos. If a shard goes down and a query needs to be sent to that shard, mongos will return the

MongoCursor::limit

(PECL mongo >=0.9.0) Limits the number of results returned public MongoCursor MongoCursor::limit ( int $num ) Parameters: num The number of results to return. Returns: Returns this cursor. Exception: Throws MongoCursorException if this cursor has started iterating.

MongoCursor::immortal

(PECL mongo >=1.0.1) Sets whether this cursor will timeout public MongoCursor MongoCursor::immortal ([ bool $liveForever = true ] ) After remaining idle on the server for some amount of time, cursors, by default, "die." This is generally the behavior one wants. The database cleans up a cursor once all of its results have been sent to the client, but if the client doesn't request all of the results, the cursor will langui