public function addDatabase(string $name, MongoDatabase $database): MongoManager
    {
        if (isset($this->databases[$name])) {
            throw new ODMException("Database '{$name}' already exists");
        }

        $this->databases[$name] = $database;

        return $this;
    }
public function addDatabase(string $name, MongoDatabase $database): MongoManager
    {
        if (isset($this->databases[$name])) {
            throw new ODMException("Database '{$name}' already exists");
        }

        $this->databases[$name] = $database;

        return $this;
    }
public function addDatabase ( string $ name , MongoDatabase $ database ) : MongoManager { if ( isset ( $ this -> databases [ $ name ] ) ) { throw new ODMException ( "Database '{$name}' already exists" ) ; } $ this -> databases [ $ name ] = $ database ; return $ this ; }
Add new database in a database pull, database name will be automatically selected from given
instance.

@param string        $name Internal database name.
@param MongoDatabase $database

@return self|$this

@throws ODMException
Add new database in a database pull database name will be automatically selected from given instance .