MongoCursorInterface::getReadPreference

(PECL mongo >=1.6.0) Get the read preference for this query abstract public array MongoCursorInterface::getReadPreference ( void ) Returns: This function returns an array describing the read preference. The array contains the values type for the string read preference mode (corresponding to the MongoClient constants), and tagsets containing a list of all tag set criteria. If no tag sets were speci

MongoCursorInterface::dead

(PECL mongo >=1.5.0) Checks if there are results that have not yet been sent from the database abstract public bool MongoCursorInterface::dead ( void ) This method checks whether the cursor has been exhausted and the database has no more results to send to the client. A cursor being "dead" does not necessarily mean that there are no more results available for iteration. Returns: Returns TRUE if

MongoCursorInterface::batchSize

(PECL mongo >=1.5.0) Limits the number of elements returned in one batch. abstract public MongoCursorInterface MongoCursorInterface::batchSize ( int $batchSize ) A cursor typically fetches a batch of result objects and stores them locally. This method sets the batch size value to configure the amount of documents retrieved from the server in one round trip. Parameters: batchSize

MongoCursor::valid

(PECL mongo >=0.9.0) Checks if the cursor is reading a valid result. public bool MongoCursor::valid ( void ) Returns: TRUE if the current result is not null, and FALSE otherwise. See also: Iterator::valid() -

MongoCursor::timeout

(PECL mongo >=1.0.3) Sets a client-side timeout for this query public MongoCursor MongoCursor::timeout ( int $ms ) A timeout can be set at any time and will affect subsequent queries on the cursor, including fetching more results from the database. Parameters: ms The number of milliseconds for the cursor to wait for a response. Use -1 to wait forever. By default, the c

MongoCursor::tailable

(PECL mongo >=0.9.4) Sets whether this cursor will be left open after fetching the last results public MongoCursor MongoCursor::tailable ([ bool $tail = true ] ) Mongo has a feature known as tailable cursors which are similar to the Unix "tail -f" command. Tailable means cursor is not closed when the last data is retrieved. Rather, the cursor marks the final object's position. you can resume using the cursor later, fro

MongoCursor::sort

(PECL mongo >=0.9.0) Sorts the results by given fields public MongoCursor MongoCursor::sort ( array $fields ) Parameters: fields An array of fields by which to sort. Each element in the array has as key the field name, and as value either 1 for ascending sort, or -1 for descending sort. Each result is first sorted on the first field in the array, then (if it exists) on

MongoCursor::snapshot

(PECL mongo >=0.9.4) Use snapshot mode for the query public MongoCursor MongoCursor::snapshot ( void ) Use snapshot mode for the query. Snapshot mode ensures that a document will not be returned more than once because an intervening write operation results in a move of the document. Documents inserted or deleted during the lifetime of the cursor may or may not be returned, irrespective of snapshot mode. Queries with sho

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

(PECL mongo >=0.9.0) Skips a number of results public MongoCursor MongoCursor::skip ( int $num ) Parameters: num The number of results to skip. Returns: Returns this cursor. Exception: Throws MongoCursorException if this cursor has started iterating. See also: