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

(PECL mongo >=1.6.0) Set the read preference for this query abstract public MongoCursorInterface MongoCursorInterface::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

MongoCursorInterface::info

(PECL mongo >=1.5.0) Gets information about the cursor's creation and iteration abstract public array MongoCursorInterface::info ( void ) Returns information about the cursor's creation and iteration. 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

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

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.