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

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

(PECL mongo >=0.9.5) Clears any flagged errors on the database public array MongoDB::resetError ( void ) This method is not used in normal operations. It resets the database error tracker (which can be incremented with MongoDB::forceError(), also not normally used). It is equivalent to running: <?php public function resetError() {     return $this->command(array('reseterror' => 1)); } ?>

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

(PECL mongo >=0.9.5) Checks for the last error thrown during a database operation public array MongoDB::prevError ( void ) MongoDB::lastError() is usually preferred to this. This method returns the last database error that occurred and how many operations ago it occurred. It is mostly deprecated. Returns: Returns the error and the number of operations ago it occurred.

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

(PECL mongo >=0.9.5) Check if there was an error on the most recent db operation performed public array MongoDB::lastError ( void ) This method is equivalent to: <?php public function lastError() {     return $this->command(array('getlasterror' => 1)); } ?> Returns: Returns the error, if there was one. Examples: M