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

MongoDB\GridFS\Bucket::getReadConcern()

On this page

  • Definition
  • Return Values
  • Example
  • See Also

New in version 1.2.

MongoDB\GridFS\Bucket::getReadConcern()

Returns the read concern for this GridFS bucket.

function getReadConcern(): MongoDB\Driver\ReadConcern

A MongoDB\Driver\ReadConcern object.

<?php
$database = (new MongoDB\Client)->selectDatabase('test');
$bucket = $database->selectGridFSBucket([
'readConcern' => new MongoDB\Driver\ReadConcern('majority'),
]);
var_dump($bucket->getReadConcern());

The output would then resemble:

object(MongoDB\Driver\ReadConcern)#3 (1) {
["level"]=>
string(8) "majority"
}
← getFilesCollection()