The Mongo class
A connection between PHP and MongoDB.
This class is used to create and manage connections. A typical use is:
$m = new Mongo(); // connect
$db = $m->foo; // get the database named "foo"
- PHP driver version. May be suffixed with "+" or "-" if it is in-between versions.
- Host to connect to if no host is given.
- Port to connect to if no port is given.
- If this is a persistent connection, if the connection was created for this object or is being reused. If this is not a persistent connection, this field should be NULL.
MongoDB core docs on » connecting.
Table of Contents
- Mongo::close - Closes this connection
- Mongo::connect - Connects to a database server
- Mongo::connectUtil - Connects with a database server
- Mongo::__construct - Creates a new database connection object
- Mongo::dropDB - Drops a database [deprecated]
- Mongo::__get - Gets a database
- Mongo::getHosts - Updates status for all hosts associated with this
- Mongo::getPoolSize - Get pool size for connection pools
- Mongo::getSlave - Returns the address being used by this for slaveOkay reads
- Mongo::getSlaveOkay - Get slaveOkay setting for this connection
- Mongo::listDBs - Lists all of the databases available.
- Mongo::poolDebug - Returns information about all connection pools.
- Mongo::selectCollection - Gets a database collection
- Mongo::selectDB - Gets a database
- Mongo::setPoolSize - Set the size for future connection pools.
- Mongo::setSlaveOkay - Change slaveOkay setting for this connection
- Mongo::switchSlave - Choose a new slave for slaveOkay reads
- Mongo::__toString - String representation of this connection