MongoCollection::deleteIndexes

(PECL mongo >=0.9.0) Delete all indices for this collection public array MongoCollection::deleteIndexes ( void ) Returns: Returns the database response. Examples: MongoCollection::deleteIndexes() example This example demonstrates how to delete all indexes from a collection and the response to expect. <?php $collectio

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

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

(PECL mongo >=1.3.0) Perform an aggregation using the aggregation framework public array MongoCollection::aggregate ( array $pipeline [, array $options ] ) public array MongoCollection::aggregate ( array $op [, array $op [, array $... ]] ) The MongoDB » aggregation framework provides a means to calculate aggregated values without having to use MapReduce. While MapReduce is powerful, it is often more difficult than necess

MongoDB::__toString

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