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

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

(PECL mongo >=0.9.0) Gets this database's profiling level public int MongoDB::getProfilingLevel ( void ) This returns the current database profiling level. The database profiler tracks query execution times. If you turn it on (say, using MongoDB::setProfilingLevel() or the shell), you can see how many queries took longer than a given number of milliseconds or the timing for all queries. Note that profiling slows down

MongoDB::getGridFS

(PECL mongo >=0.9.0) Fetches toolkit for dealing with files stored in this database public MongoGridFS MongoDB::getGridFS ([ string $prefix = "fs" ] ) Parameters: prefix The prefix for the files and chunks collections. Returns: Returns a new gridfs object for this database. Examples:

MongoDB::getDBRef

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

MongoDB::getCollectionNames

(PECL mongo >=1.3.0) Gets an array of names for all collections in this database public array MongoDB::getCollectionNames ([ array $options = array() ] ) Gets a list of all collections in the database and returns their names as an array of strings. Note: This method will use the » listCollections database command when communicating with MongoDB 2.8+. For previous database versions, the method will query the special syst

MongoDB::getCollectionInfo

(PECL mongo >=1.6.0) Returns information about collections in this database public array MongoDB::getCollectionInfo ([ array $options = array() ] ) Gets a list of all collections in the database and returns them as an array of documents, which contain their names and options. Note: This method will use the » listCollections database command when communicating with MongoDB 2.8+. For previous database versions, the method

MongoDB::__get

(PECL mongo >=1.0.2) Gets a collection public MongoCollection MongoDB::__get ( string $name ) This is the easiest way of getting a collection from a database object. 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("bar")

MongoDB::forceError

(PECL mongo >=0.9.5) Creates a database error public bool MongoDB::forceError ( void ) This method is not very useful for normal MongoDB use. It forces a database error to occur. This means that MongoDB::lastError() will return a generic database error after running this command. This command is identical to running: <?php public function forceError() {     return $this->command(array('forceerror' => 1)); }