MongoDB::execute

(PECL mongo >=0.9.3) Runs JavaScript code on the database server [deprecated] public array MongoDB::execute ( mixed $code [, array $args = array() ] ) The Mongo database server runs a JavaScript engine. This method allows you to run arbitary JavaScript on the database. This can be useful if you want touch a number of collections lightly, or process some results on the database side to reduce the amount that has to be sen

MongoDB::dropCollection

(PECL mongo >=0.9.0) Drops a collection [deprecated] public array MongoDB::dropCollection ( mixed $coll ) Parameters: coll MongoCollection or name of collection to drop. Returns: Returns the database response. Deprecated Use MongoCollection::drop() instead. This function leaks memory in version 1.0.7 and

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)); }

MongoDB::drop

(PECL mongo >=0.9.0) Drops this database public array MongoDB::drop ( void ) This drops the database currently being used. This is identical to running: <?php public function drop() {     $this->command(array("dropDatabase" => 1)); } ?> Returns: Returns the database response. Examples: MongoDB::drop() example

MongoClient::__toString

(PECL mongo >=1.3.0) String representation of this connection public string MongoClient::__toString ( void ) Returns: Returns hostname and port for this connection.

MongoClient::setReadPreference

(PECL mongo >=1.3.0) Set the read preference for this connection public bool MongoClient::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::authenticate

(PECL mongo >=1.0.1) Log in to this database public array MongoDB::authenticate ( string $username, string $password ) This method causes its connection to be authenticated. If authentication is enabled for the database server (it's not, by default), you need to log in before the database will allow you to do anything. In general, you should use the authenticate built into MongoClient::__construct() in preference to thi

MongoDB::createCollection

(PECL mongo >=0.9.0) Creates a collection public MongoCollection MongoDB::createCollection ( string $name [, array $options ] ) This method is used to create capped collections and other collections requiring special options. It is identical to running: <?php $collection = $db->command(array(     "create" => $name,     "capped" => $options["capped"],     "size" => $options["size"],     "max" => $opti

MongoDB::__construct

(PECL mongo >=0.9.0) Creates a new database public MongoDB::__construct ( MongoClient $conn, string $name ) This method is not meant to be called directly. The preferred way to create an instance of MongoDB is through MongoClient::__get() or MongoClient::selectDB(). If you're ignoring the previous paragraph and want to call it directly you can do so: <?php $m = new MongoClient(); $db = new MongoDB($m, 'mydbname')

MongoClient::selectDB

(PECL mongo >=1.3.0) Gets a database public MongoDB MongoClient::selectDB ( string $name ) Parameters: name The database name. Returns: Returns a new database object. Exception: Throws Exception if the database name is invalid.