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:

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

MongoClient::selectCollection

(PECL mongo >=1.3.0) Gets a database collection public MongoCollection MongoClient::selectCollection ( string $db, string $collection ) Parameters: db The database name. collection The collection name. Returns: Returns a new collection object. Exception: Throws Exception if th

MongoClient::listDBs

(PECL mongo >=1.3.0) Lists all of the databases available. public array MongoClient::listDBs ( void ) Returns: Returns an associative array containing three fields. The first field is databases, which in turn contains an array. Each element of the array is an associative array corresponding to a database, giving th database's name, size, and if it's empty. The other two fields are totalSize (in b

MongoClient::killCursor

(PECL mongo >=1.5.0) Kills a specific cursor on the server public bool MongoClient::killCursor ( string $server_hash, int|MongoInt64 $id ) In certain situations it might be needed to kill a cursor on the server. Usually cursors time out after 10 minutes of inactivity, but it is possible to create an immortal cursor with MongoCursor::immortal() that never times out. In order to be able to kill such an immortal cursor, you

MongoClient::getReadPreference

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

MongoClient::getWriteConcern

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

MongoClient::close

(PECL mongo >=1.3.0) Closes this connection public bool MongoClient::close ([ boolean|string $connection ] ) The MongoClient::close() method forcefully closes a connection to the database, even if persistent connections are being used. You should never have to do this under normal circumstances. Parameters: connection If connection is not given, or FALSE then connecti

MongoClient::dropDB

(PECL mongo >=1.3.0) Drops a database [deprecated] public array MongoClient::dropDB ( mixed $db ) Parameters: db The database to drop. Can be a MongoDB object or the name of the database. Returns: Returns the database response. Deprecated Use MongoDB::drop() instead.

MongoClient::getHosts

(PECL mongo >=1.3.0) Updates status for all associated hosts public array MongoClient::getHosts ( void ) This method is only useful with a connection to a replica set. It returns the status of all of the hosts in the set. Without a replica set, it will just return an array with one element containing the host that you are connected to. See the query section of this manual for information on distributing reads to seconda