protected function setupMongoDB($dsn, $options)
    {
        try {
            $this->client = new \MongoDB\Client($dsn, $options);
            $this->dbh    = $this->client->selectDatabase($this->dbName);
        } catch (\MongoDB\Driver\Exception $e) {
            throw new ModuleException($this, sprintf('Failed to open Mongo connection: %s', $e->getMessage()));
        }
    }
protected function setupMongoDB($dsn, $options)
    {
        try {
            $this->client = new \MongoDB\Client($dsn, $options);
            $this->dbh    = $this->client->selectDatabase($this->dbName);
        } catch (\MongoDB\Driver\Exception $e) {
            throw new ModuleException($this, sprintf('Failed to open Mongo connection: %s', $e->getMessage()));
        }
    }
protected function setupMongoDB ( $ dsn , $ options ) { try { $ this -> client = new \ MongoDB \ Client ( $ dsn , $ options ) ; $ this -> dbh = $ this -> client -> selectDatabase ( $ this -> dbName ) ; } catch ( \ MongoDB \ Driver \ Exception $ e ) { throw new ModuleException ( $ this , sprintf ( 'Failed to open Mongo connection: %s' , $ e -> getMessage ( ) ) ) ; } }
Connect to the Mongo server using the MongoDB extension.
Connect to the Mongo server using the MongoDB extension .