@param string $collectionName

@return string
330892
protected function getCollectionFilePath(string $collectionName): string
    {
        return $this->storageDir . '/' . $this->dbName . '_'
            . $this->normalize($collectionName) . '.' . self::EXTENSION;
    }
750241
public function getFirstMediaUrl(string $collectionName = 'default', string $conversionName = ''): string
    {
        $media = $this->getFirstMedia($collectionName);

        if (! $media) {
            return '';
        }

        return $media->getUrl($conversionName);
    }
234720
function makeMongooseModelName(collectionName) {
    if (collectionName !== collectionName.toLowerCase()) {
        throw new Error('expect lowercase, was ' + collectionName);
    }
    if (collectionName.charAt(collectionName.length - 1) === 's') {
        return collectionName.substring(0, collectionName.length - 1);
    }
    throw new Error('expected name with trailing s');
}
6774
protected function makeFields(Collection $fields = null)
    {
        if (is_null($fields))
        {
            return '';
        }

        $fields = $fields->pluck('name')->toArray();

        return count($fields) ? "'" . implode("', '", $fields) . "'" : '';
    }
705320
public function listIndexes($collectionName, $options = [])
    {
        $this->document = $this->db->getQueryBuilder()->listIndexes($collectionName, $options);

        try {
            $cursor = $this->execute();
        } catch (Exception $e) {
            // The server may return an error if the collection does not exist.
            $notFoundCodes = [
                26, // namespace not found
                60 // database not found
            ];
            if (in_array($e->getCode(), $notFoundCodes, true)) {
                return [];
            }

            throw $e;
        }

        return $cursor->toArray();
    }
175140
public function createCollection($collectionName, array $options = [])
    {
        $this->document = $this->db->getQueryBuilder()->createCollection($collectionName, $options);

        $result = current($this->execute()->toArray());
        return $result['ok'] > 0;
    }
336833
public function getCollection($name)
    {
        return array_key_exists($name, $this->collectionsByName) ? $this->collectionsByName[$name] : null;
    }
579270
public function getCollectionPages($collectionId)
    {
        $pageMapper = ($this->container->dataMapper)('PageMapper');

        // Page Collection
        $data = $pageMapper->findCollectionPagesById($collectionId);

        return $data;
    }
757099
public function selectCollection($name)
    {
        if (!isset($this->collection_cache[$name])) {
            $collection = new Collection($name, $this);
            $collection_cache[$name] = $collection;
        }

        return $collection_cache[$name];
    }
1226717
public function getCollection(string $collectionName): Collection
    {
        $collectionFile = $this->getCollectionFilePath($collectionName);
        $storage = $this->factory->storage($collectionFile, $this->type);
        return $this->factory->collection($storage);
    }
461053
protected function collectionExists($collectionName): bool
    {
        foreach ($this->database->listCollections() as $collection) {
            if ($collection->getName() === $collectionName) {
                return true;
            }
        }

        return false;
    }
962503
public function selectCollection($collectionName, array $options = [])
    {
        $options += [
            'readConcern' => $this->readConcern,
            'readPreference' => $this->readPreference,
            'writeConcern' => $this->writeConcern,
        ];

        return new Collection($this->manager, $this->databaseName, $collectionName, $options);
    }
1118301
public static function fieldName($project, $database, $collectionId, $fieldId)
    {
        return self::getFieldNameTemplate()->render([
            'project' => $project,
            'database' => $database,
            'collection_id' => $collectionId,
            'field_id' => $fieldId,
        ]);
    }
216379
public function getOne($collection = "")
		{
			if (empty($collection)) {
				throw new Exception("In order to retrieve documents from MongoDB you must provide a collection name.");
			}

			$returns = $this->db->{$collection}->findOne($this->wheres, $this->selects);

			$this->_clear();

			return $returns;
		}
59132
public function getDocumentCollection($className)
    {
        $className = ltrim($className, '\\');

        $metadata = $this->metadataFactory->getMetadataFor($className);
        $collectionName = $metadata->getCollection();

        if ( ! $collectionName) {
            throw MongoDBException::documentNotMappedToCollection($className);
        }

        if ( ! isset($this->documentCollections[$className])) {
            $db = $this->getDocumentDatabase($className);

            $this->documentCollections[$className] = $metadata->isFile()
                ? $db->getGridFS($collectionName)
                : $db->selectCollection($collectionName);
        }

        $collection = $this->documentCollections[$className];

        if ($metadata->slaveOkay !== null) {
            $collection->setSlaveOkay($metadata->slaveOkay);
        }

        return $this->documentCollections[$className];
    }
710957
protected function collectionRouteList($routeName, Collection $collection, $key = 'id')
    {
        $keys = $collection->pluck($key);

        return array_map(function ($key) use ($routeName) {
            return route($routeName, $key);
        }, $keys->all());
    }
57004
public function insert($collectionName, $data)
    {
        $id = 0;
        $sql = $this->dialect->grammarInsert($collectionName, $data);

        $stid = oci_parse($this->raw, $sql);

        //Fixme : problem from other oracle dialect on method insert
        oci_bind_by_name($stid, ":id", $id,-1,SQLT_INT);

        foreach ($data as $key => $value) {
            oci_bind_by_name($stid, ":".$key, $data[$key]);
        }

        oci_execute($stid);

        oci_free_statement($stid);

        return $id;
    }