yii\mongodb\Connection::getFileCollection PHP Method

getFileCollection() public method

Returns the MongoDB GridFS collection.
public getFileCollection ( string | array $prefix = 'fs', boolean $refresh = false ) : Collection
$prefix string | array collection prefix. If string considered as the prefix of the GridFS collection inside the default database. If array - first element considered as the name of the database, second - as prefix of the GridFS collection inside that database, if no second element present default "fs" prefix will be used.
$refresh boolean whether to reload the collection instance even if it is found in the cache.
return yii\mongodb\file\Collection Mongo GridFS collection instance.
    public function getFileCollection($prefix = 'fs', $refresh = false)
    {
        if (is_array($prefix)) {
            list($dbName, $collectionPrefix) = $prefix;
            if (!isset($collectionPrefix)) {
                $collectionPrefix = 'fs';
            }
            return $this->getDatabase($dbName)->getFileCollection($collectionPrefix, $refresh);
        } else {
            return $this->getDatabase()->getFileCollection($prefix, $refresh);
        }
    }