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

(PECL mongo >=1.5.0) Set the write concern for this database public bool MongoDB::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 to wait

MongoDB::setReadPreference

(PECL mongo >=1.3.0) Set the read preference for this database public bool MongoDB::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.

MongoDB::setSlaveOkay

(PECL mongo >=1.1.0) Change slaveOkay setting for this database public bool MongoDB::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 MongoDB instance. Returns

MongoDB::getReadPreference

(PECL mongo >=1.3.0) Get the read preference for this database public array MongoDB::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, tagsets will

MongoDB::selectCollection

(PECL mongo >=0.9.0) Gets a collection public MongoCollection MongoDB::selectCollection ( string $name ) Parameters: name The collection name. Returns: Returns a new collection object. Exception: Throws Exception if the collection name is invalid.

MongoDB::getWriteConcern

(PECL mongo >=1.5.0) Get the write concern for this database public array MongoDB::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.

MongoDB::listCollections

(PECL mongo >=0.9.0) Gets an array of MongoCollection objects for all collections in this database public array MongoDB::listCollections ([ array $options = array() ] ) Gets a list of all collections in the database and returns them as an array of MongoCollection objects. Note: This method will use the » listCollections database command when communicating with MongoDB 2.8+. For previous database versions, the method wil

MongoDB::repair

(PECL mongo >=0.9.0) Repairs and compacts this database public array MongoDB::repair ([ bool $preserve_cloned_files = FALSE [, bool $backup_original_files = FALSE ]] ) This creates a fresh copy of all database data. It will remove any corrupt data and compact and large stretches of free space it finds. This is a very slow operation on a large database. This is usually run from the shell or the command line, not the dr

MongoDB::getSlaveOkay

(PECL mongo >=1.1.0) Get slaveOkay setting for this database public bool MongoDB::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.