MongoCollection::setSlaveOkay

(PECL mongo >=1.1.0) Change slaveOkay setting for this collection public bool MongoCollection::setSlaveOkay ([ bool $ok = true ] ) See the query section of this manual for information on distributing reads to secondaries. Parameters: ok If reads should be sent to secondary members of a replica set for all possible queries using this MongoCollection instance.

MongoCollection::save

(PECL mongo >=0.9.0) Saves a document to this collection public mixed MongoCollection::save ( array|object $document [, array $options = array() ] ) If the object is from the database, update the existing database object, otherwise insert this object. Parameters: document Array or object to save. If an object is used, it may not have protected or private properties.

MongoCollection::setReadPreference

(PECL mongo >=1.3.0) Set the read preference for this collection public bool MongoCollection::setReadPreference ( string $read_preference [, array $tags ] ) Parameters: read_preference The read preference mode: MongoClient::RP_PRIMARY, MongoClient::RP_PRIMARY_PREFERRED, MongoClient::RP_SECONDARY, MongoClient::RP_SECONDARY_PREFERRED, or MongoClient::RP_NEAREST.

MongoCollection::insert

(PECL mongo >=0.9.0) Inserts a document into the collection public bool|array MongoCollection::insert ( array|object $document [, array $options = array() ] ) All strings sent to the database must be UTF-8. If a string is not UTF-8, a MongoException will be thrown. To insert (or query for) a non-UTF-8 string, use MongoBinData. Parameters: document An array or object

MongoCollection::parallelCollectionScan

(PECL mongo >=1.5.0) Returns an array of cursors to iterator over a full collection in parallel public array[MongoCommandCursor] MongoCollection::parallelCollectionScan ( int $num_cursors ) This method returns an array of a maximum of num_cursors cursors. An iteration over one of the returned cursors results in a partial set of documents for a collection. Iteration over all the returned cursors results in getting every d

MongoCollection::group

(PECL mongo >=0.9.2) Performs an operation similar to SQL's GROUP BY command public array MongoCollection::group ( mixed $keys, array $initial, MongoCode $reduce [, array $options = array() ] ) Parameters: keys Fields to group by. If an array or non-code object is passed, it will be the key used to group results. 1.0.4+: If keys is an instance of MongoCode, keys will b

MongoCollection::remove

(PECL mongo >=0.9.0) Remove records from this collection public bool|array MongoCollection::remove ([ array $criteria = array() [, array $options = array() ]] ) Parameters: criteria Query criteria for the documents to delete. options An array of options for the remove operation. Currently available options include: "w" See Write C

MongoCollection::findOne

(PECL mongo >=0.9.0) Queries this collection, returning a single element public array MongoCollection::findOne ([ array $query = array() [, array $fields = array() [, array $options = array() ]]] ) As opposed to MongoCollection::find(), this method will return only the first result from the result set, and not a MongoCursor that can be iterated over. Parameters: query

MongoCollection::getReadPreference

(PECL mongo >=1.3.0) Get the read preference for this collection public array MongoCollection::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, tag

MongoCollection::findAndModify

(PECL mongo >=1.3.0) Update a document and return it public array MongoCollection::findAndModify ( array $query [, array $update [, array $fields [, array $options ]]] ) The findAndModify command atomically modifies and returns a single document. By default, the returned document does not include the modifications made on the update. To return the document with the modifications made on the update, use the new option.