protected function getGrid()
{
if ($this->grid === null) {
try {
$database = $this->getMongoClient()->selectDB($this->params['databaseName']);
$this->grid = $database->getGridFS();
} catch (MongoException $e) {
throw new StorageException('Could not connect to database', 500, $e);
}
}
return $this->grid;
}