MongoCollection::find

(PECL mongo >=0.9.0) Queries this collection, returning a MongoCursor for the result set public MongoCursor MongoCollection::find ([ array $query = array() [, array $fields = array() ]] ) Parameters: query The fields for which to search. MongoDB's query language is quite extensive. The PHP driver will in almost all cases pass the query straight through to the server, s

MongoCollection::deleteIndex

(PECL mongo >=0.9.0) Deletes an index from this collection public array MongoCollection::deleteIndex ( string|array $keys ) This method is identical to: <?php public function deleteIndexes($keys) {   $indexName = $this->toIndexString($keys);   return $this->db->command(array(     "deleteIndexes" => $this->getName(),     "index" => $indexName,   )); } ?> Each index is given a unique name

MongoCollection::createIndex

(PECL mongo >=1.5.0) Creates an index on the specified field(s) if it does not already exist. public bool MongoCollection::createIndex ( array $keys [, array $options = array() ] ) Creates an index on the specified field(s) if it does not already exist. Fields may be indexed with a direction (e.g. ascending or descending) or a special type (e.g. text, geospatial, hashed). Note: This method will use the » createInde

MongoCollection::count

(PECL mongo >=0.9.0) Counts the number of documents in this collection public int MongoCollection::count ([ array $query = array() [, array $options = array() ]] ) Parameters: query Associative array or object with fields to match. options An array of options for the index creation. Currently available options include: Name Type Des

MongoCollection::batchInsert

(PECL mongo >=0.9.0) Inserts multiple documents into this collection public mixed MongoCollection::batchInsert ( array $a [, array $options = array() ] ) Parameters: a An array of arrays or objects. If any objects are used, they may not have protected or private properties. Note: If the documents to insert do not have an _id key or property, a new MongoId instance w

MongoCollection::aggregateCursor

(PECL mongo >=1.5.0) Execute an aggregation pipeline command and retrieve results through a cursor public MongoCommandCursor MongoCollection::aggregateCursor ( array $command [, array $options ] ) With this method you can execute Aggregation Framework pipelines and retrieve the results through a cursor, instead of getting just one document back as you would with MongoCollection::aggregate(). This method returns a MongoCom

MongoCollection::createDBRef

(PECL mongo >=0.9.0) Creates a database reference public array MongoCollection::createDBRef ( mixed $document_or_id ) Parameters: document_or_id If an array or object is given, its _id field will be used as the reference ID. If a MongoId or scalar is given, it will be used as the reference ID. Returns: Returns a database reference array. If an

MongoCollection::__construct

(PECL mongo >=0.9.0) Creates a new collection public MongoCollection::__construct ( MongoDB $db, string $name ) Parameters: MongoDB db Parent database. Returns: Returns a new collection object. Exception: Throws default exception if the collection name is invalid.

MongoDB::__toString

(PECL mongo >=0.9.0) The name of this database public string MongoDB::__toString ( void ) Returns: Returns this database's name.

MongoDB::setProfilingLevel

(PECL mongo >=0.9.0) Sets this database's profiling level public int MongoDB::setProfilingLevel ( int $level ) This changes the current database profiling level. This function is equivalent to running: <?php public function setProfilingLevel($level) {     return $this->command(array('profile' => $level)); } ?> The options for level are 0 (off), 1 (queries > 100ms), and 2 (all queries). If you wou