public function storeBytes($bytes, array $extra = [], array $options = [])
    {
        $this->createChunksIndex();

        $record = $extra + [
            'length' => mb_strlen($bytes, '8bit'),
            'md5' => md5($bytes),
        ];

        try {
            $file = $this->insertFile($record, $options);
        } catch (MongoException $e) {
            throw new MongoGridFSException('Could not store file: ' . $e->getMessage(), $e->getCode(), $e);
        }

        try {
            $this->insertChunksFromBytes($bytes, $file);
        } catch (MongoException $e) {
            $this->delete($file['_id']);
            throw new MongoGridFSException('Could not store file: ' . $e->getMessage(), $e->getCode(), $e);
        }

        return $file['_id'];
    }