Docs Menu

Docs HomePHP Library Manual

MongoDB\GridFS\Bucket::getWriteConcern()

On this page

  • Definition
  • Return Values
  • Example
  • See Also

New in version 1.2.

MongoDB\\GridFS\\Bucket::getWriteConcern()

Returns the write concern for this GridFS bucket.

function getWriteConcern(): MongoDB\Driver\WriteConcern

A MongoDB\\Driver\\WriteConcern object.

<?php
$database = (new MongoDB\Client)->selectDatabase('test');
$bucket = $database->selectGridFSBucket([
'writeConcern' => new MongoDB\Driver\WriteConcern(1, 0, true),
]);
var_dump($bucket->getWriteConcern());

The output would then resemble:

object(MongoDB\Driver\WriteConcern)#3 (2) {
["w"]=>
int(1)
["j"]=>
bool(true)
}
←  MongoDB\GridFS\Bucket::getTypeMap()MongoDB\GridFS\Bucket::openDownloadStream() →