public function connect(array $config)
{
if (!is_null($this->connection)) {
return;
}
$this->config = $config;
$options = array_get($this->config, 'options', array());
$this->connection = new \MongoClient($this->getDsn($config), $options);
//Select database
$this->db = $this->connection->{$config['database']};
return $this;
}