Docs Menu
Docs Home
/ / /
PHP Library Manual
/ /

MongoDB\GridFS\Bucket::getFilesCollection()

On this page

  • Definition
  • Return Values
  • Examples

New in version 1.2.

MongoDB\GridFS\Bucket::getFilesCollection()

Returns the files collection used by the bucket.

function getFilesCollection(): MongoDB\Collection

A MongoDB\Collection object for the files collection.

<?php
$bucket = (new MongoDB\Client)->test->selectGridFSBucket();
$filesCollection = $bucket->getFilesCollection();
var_dump($filesCollection->getCollectionName());

The output would then resemble:

string(8) "fs.files"

Back

getFileIdForStream()

Next

getReadConcern()