MongoCollection::getSlaveOkay

(PECL mongo >=1.1.0) Get slaveOkay setting for this collection public bool MongoCollection::getSlaveOkay ( void ) See the query section of this manual for information on distributing reads to secondaries. Returns: Returns the value of slaveOkay for this instance. Changelog: 1.2.11 Emits E_DEPRECATED when used.

MongoCollection::getDBRef

(PECL mongo >=0.9.0) Fetches the document pointed to by a database reference public array MongoCollection::getDBRef ( array $ref ) Parameters: ref A database reference. Returns: Returns the database document pointed to by the reference. Examples: MongoCollection::getDBRef() example

MongoCollection::getName

(PECL mongo >=0.9.0) Returns this collection's name public string MongoCollection::getName ( void ) Returns: Returns the name of this collection. Examples: MongoCollection::getName() example <?php $m = new MongoClient(); $c = $m->foo->bar->baz; echo "Working with collection " . $c->getName() . ".\n"; //

MongoCollection::__get

(PECL mongo >=1.0.2) Gets a collection public MongoCollection MongoCollection::__get ( string $name ) A concise syntax for getting a collection with a dot-separated name. If a collection name contains strange characters, you may have to use MongoDB::selectCollection() instead. <?php $mongo = new MongoClient(); // the following two lines are equivalent $collection = $mongo->selectDB("foo")->selectCollection("

MongoCollection::getIndexInfo

(PECL mongo >=0.9.0) Returns information about indexes on this collection public array MongoCollection::getIndexInfo ( void ) Returns: This function returns an array in which each element describes an index. Elements will contain the values name for the name of the index, ns for the namespace (a combination of the database and collection name), and key for a list of all fields in the index and th

MongoCollection::getWriteConcern

(PECL mongo >=1.5.0) Get the write concern for this collection public array MongoCollection::getWriteConcern ( void ) Returns: This function returns an array describing the write concern. The array contains the values w for an integer acknowledgement level or string mode, and wtimeout denoting the maximum number of milliseconds to wait for the server to satisfy the write concern.

MongoCollection::distinct

(PECL mongo >=1.2.11) Retrieve a list of distinct values for the given key across a collection. public array MongoCollection::distinct ( string $key [, array $query ] ) The distinct command returns a list of distinct values for the given key across a collection. Parameters: key The key to use. query An optional query parameters

MongoCollection::ensureIndex

(PECL mongo >=0.9.0) Creates an index on the specified field(s) if it does not already exist. public bool MongoCollection::ensureIndex ( string|array $key|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

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

(PECL mongo >=0.9.0) Drops this collection public array MongoCollection::drop ( void ) Drops this collection and deletes its indices. Returns: Returns the database response. Examples: MongoCollection::drop() example This example demonstrates how to drop a collection and the response to expect. <?php $collection = $