protected function getMongoClient()
{
if ($this->mongoClient === null) {
try {
$this->mongoClient = new MongoClient($this->params['server'], $this->params['options']);
} catch (MongoException $e) {
throw new StorageException('Could not connect to database', 500, $e);
}
}
return $this->mongoClient;
}