Docs Menu
Docs Home
/ / /
PHP 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)
}
  • Write Concern in the MongoDB manual

  • MongoDB\Driver\WriteConcern::isDefault()

  • MongoDB\Client::getWriteConcern()

  • MongoDB\Collection::getWriteConcern()

  • MongoDB\Database::getWriteConcern()

Back

getTypeMap()