MongoCursor::setReadPreference

(PECL mongo >=1.3.3) Set the read preference for this query public MongoCursor MongoCursor::setReadPreference ( string $read_preference [, array $tags ] ) Parameters: read_preference The read preference mode: MongoClient::RP_PRIMARY, MongoClient::RP_PRIMARY_PREFERRED, MongoClient::RP_SECONDARY, MongoClient::RP_SECONDARY_PREFERRED, or MongoClient::RP_NEAREST.

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::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::reset

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

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::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::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::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::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::info

(PECL mongo >=1.0.5) Gets information about the cursor's creation and iteration public array MongoCursor::info ( void ) This can be called before or after the cursor has started iterating. Returns: Returns the namespace, batch size, limit, skip, flags, query, and projected fields for this cursor. If the cursor has started iterating, additional information about iteration and the connection will