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

MongoCursor::hint

(PECL mongo >=0.9.0) Gives the database a hint about the query public MongoCursor MongoCursor::hint ( mixed $index ) Parameters: index Index to use for the query. If a string is passed, it should correspond to an index name. If an array or object is passed, it should correspond to the specification used to create the index (i.e. the first argument to MongoCollection::ens

MongoCursor::hasNext

(PECL mongo >=0.9.0) Checks if there are any more elements in this cursor public bool MongoCursor::hasNext ( void ) Returns: Returns if there is another element. Exception: Throws MongoConnectionException if it cannot reach the database and MongoCursorTimeoutException if the timeout is exceeded.

MongoCursor::getReadPreference

(PECL mongo >=1.3.3) Get the read preference for this query public array MongoCursor::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 specified, tagsets will

MongoCursor::getNext

(PECL mongo >=0.9.0) Advances the cursor to the next result, and returns that result public array MongoCursor::getNext ( void ) Note: MongoCursor::getNext() is an alias of MongoCursor::next().

MongoCursor::fields

(PECL mongo >=1.0.6) Sets the fields for a query public MongoCursor MongoCursor::fields ( array $f ) Fields are specified by "fieldname" : bool. TRUE indicates that a field should be returned, FALSE indicates that it should not be returned. You can also use 1 and 0 instead of TRUE and FALSE. Thus, to return only the "summary" field, one could say: <?php $cursor->fields(array("summary" => true)); ?>

MongoCursor::explain

(PECL mongo >=0.9.2) Return an explanation of the query, often useful for optimization and debugging public array MongoCursor::explain ( void ) Returns: Returns an explanation of the query. Exception: Throws MongoConnectionException if it cannot reach the database. Examples: MongoCursor::explain() example

MongoCursor::doQuery

(PECL mongo >=0.9.0 <1.6.0) Execute the query. protected void MongoCursor::doQuery ( void ) This function actually queries the database. All queries and commands go through this function. Thus, this function can be overridden to provide custom query handling. This handles serializing your query, sending it to the database, receiving a response, and deserializing it. Thus, if you are planning to override this, your c

MongoCursor::dead

(PECL mongo >=0.9.6) Checks if there are results that have not yet been sent from the database public bool MongoCursor::dead ( void ) The database sends responses in batches of documents, up to 4MB of documents per response. This method checks if the database has more batches or if the result set has been exhausted. A cursor being "dead" does not mean that MongoCursor::hasNext() will return FALSE, it only means that the

MongoCursor::current

(PECL mongo >=0.9.0) Returns the current element public array MongoCursor::current ( void ) This returns NULL until MongoCursor::next() is called. Returns: The current result document as an associative array. NULL will be returned if there is no result. See also: Iterator::current() -