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

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

(PECL mongo >=0.9.0) Creates a database reference public array MongoDB::createDBRef ( string $collection, mixed $document_or_id ) This method is a flexible interface for creating database refrences (see MongoDBRef). Parameters: collection The collection to which the database reference will point. document_or_id If an array or object