Doctrine\MongoDB\Connection::connect PHP Method

connect() public method

Wrapper method for MongoClient::connect().
See also: http://php.net/manual/en/mongoclient.connect.php
public connect ( ) : boolean
return boolean
    public function connect()
    {
        $this->initialize();
        $mongoClient = $this->mongoClient;
        return $this->retry(function () use($mongoClient) {
            return $mongoClient->connect();
        });
    }

Usage Example

 /**
  * Returns the result of attempting to connect to the persistent storage server
  *
  * @return boolean
  */
 public function connect()
 {
     return $this->connection->connect();
 }