Navigation
This version of the documentation is archived and no longer supported. To learn how to upgrade your version of PHP Library Manual, refer to the upgrade documentation.

MongoDB\GridFS\Bucket::getFilesCollection()

New in version 1.2.

Definition

MongoDB\GridFS\Bucket::getFilesCollection

Returns the files collection used by the bucket.

function getFilesCollection(): MongoDB\Collection

Return Values

A MongoDB\Collection object for the files collection.

Examples

<?php

$bucket = (new MongoDB\Client)->test->selectGridFSBucket();

$filesCollection = $bucket->getFilesCollection();

var_dump($filesCollection->getCollectionName());

The output would then resemble:

string(8) "fs.files"