/**
* Creates a new database
*
* This method is not meant to be called directly. The preferred way to create an instance of MongoDB is through {@see Mongo::__get()} or {@see Mongo::selectDB()}.
* @link http://www.php.net/manual/en/mongodb.construct.php
* @param MongoClient $conn Database connection.
* @param string $name Database name.
* @throws Exception
* @return MongoDB Returns the database.
*/
public function __construct(MongoClient $conn, $name)
{
$this->connection = $conn;
$this->name = $name;
$this->setReadPreferenceFromArray($conn->getReadPreference());
$this->setWriteConcernFromArray($conn->getWriteConcern());
$this->createDatabaseObject();
}