For AI agents: a documentation index is available at https://www.mongodb.com/es/docs/llms.txt — markdown versions of all pages are available by appending .md to any URL path.
Make the MongoDB docs better! We value your opinion. Share your feedback for a chance to win $100.
MongoDB Branding Shape
Click here >
Docs Menu

MongoDB\GridFS\Bucket::getReadConcern()

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)->getDatabase('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"
}