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

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

(PECL mongo >=1.0.11) Limits the number of elements returned in one batch. public MongoCursor MongoCursor::batchSize ( int $batchSize ) A cursor typically fetches a batch of result objects and store them locally. This method sets the batchSize value to configure the amount of documents retrieved from the server in one round trip. However, it will never return more documents than fit in the max batch size limit (usually 4M

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() -