MongoCursor::count

(PECL mongo >=0.9.2) Counts the number of results for this query public int MongoCursor::count ([ bool $foundOnly = FALSE ] ) This method does not affect the state of the cursor: if you haven't queried yet, you can still apply limits, skips, etc. If you have started iterating through results, it will not move the current position of the cursor. If you have exhasted the cursor, it will not reset it. Param

MongoCursor::__construct

(PECL mongo >=0.9.0) Create a new cursor public MongoCursor::__construct ( MongoClient $connection, string $ns [, array $query = array() [, array $fields = array() ]] ) Parameters: connection Database connection. ns Full name of database and collection. query Database query.

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

(PECL mongo >=1.2.11) Sets whether this cursor will wait for a while for a tailable cursor to return more data public MongoCursor MongoCursor::awaitData ([ bool $wait = true ] ) This method is to be used with tailable cursors. If we are at the end of the data, block for a while rather than returning no data. After a timeout period, we do return as normal. Parameters: wait

MongoCursor::addOption

(PECL mongo >=1.0.4) Adds a top-level key/value pair to a query public MongoCursor MongoCursor::addOption ( string $key, mixed $value ) This is an advanced function and should not be used unless you know what you're doing. A query can optionally be nested in a "query" field if other options, such as a sort or hint, are given. For instance, adding a sort causes the query to become a subfield of a bigger query object, lik

MongoCollection::validate

(PECL mongo >=0.9.0) Validates this collection public array MongoCollection::validate ([ bool $scan_data = FALSE ] ) Parameters: scan_data Only validate indices, not the base collection. Returns: Returns the database's evaluation of this object.

MongoCollection::update

(PECL mongo >=0.9.0) Update records based on a given criteria public bool|array MongoCollection::update ( array $criteria, array $new_object [, array $options = array() ] ) Parameters: criteria Query criteria for the documents to update. new_object The object used to update the matched documents. This may either contain update operat

MongoCollection::__toString

(PECL mongo >=0.9.0) String representation of this collection public string MongoCollection::__toString ( void ) Returns: Returns the full name of this collection. Examples: MongoCollection::__toString() example <?php $m = new MongoClient(); $c1 = $m->foo->bar->baz; echo "Working with collection $c1."; $c2

MongoCollection::toIndexString

(PECL mongo >=0.9.0) Converts keys specifying an index to its identifying string static protected string MongoCollection::toIndexString ( mixed $keys ) Parameters: keys Field or fields to convert to the identifying string Returns: Returns a string that describes the index. This method is deprecated since ver

MongoCollection::setWriteConcern

(PECL mongo >=1.5.0) Set the write concern for this database public bool MongoCollection::setWriteConcern ( mixed $w [, int $wtimeout ] ) Parameters: w The write concern. This may be an integer denoting the number of servers required to acknowledge the write, or a string mode (e.g. "majority"). wtimeout The maximum number of milliseconds