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

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

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')

MongoDB::command

(PECL mongo >=0.9.2) Execute a database command public array MongoDB::command ( array $command [, array $options = array() [, string &$hash ]] ) Almost everything that is not a CRUD operation can be done with a database command. Need to know the database version? There's a command for that. Need to do aggregation? There's a command for that. Need to turn up logging? You get the idea. This method is identical to:

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

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

(PECL mongo >=1.5.0) Set the write concern for this connection public bool MongoClient::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