Doctrine\MongoDB\Connection::close PHP Method

close() public method

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

Usage Example

 protected function tearDown()
 {
     $this->oid = array();
     if ($this->connection) {
         $this->connection->close();
         $this->connection = null;
     }
     if ($this->con) {
         $this->con->drop();
         $this->con = null;
     }
 }