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

MongoDB\Client::getWriteConcern()

On this page

  • Definition
  • Return Values
  • Example
  • See Also

New in version 1.2.

MongoDB\Client::getWriteConcern()

Returns the write concern for this client.

function getWriteConcern(): MongoDB\Driver\WriteConcern

A MongoDB\Driver\WriteConcern object.

<?php
$client = new MongoDB\Client('mongodb://127.0.0.1/', [
'journal' => true,
]);
var_dump($client->getWriteConcern());

The output would then resemble:

object(MongoDB\Driver\WriteConcern)#4 (1) {
["j"]=>
bool(true)
}
  • Write Concern in the MongoDB manual

  • MongoDB\Driver\WriteConcern::isDefault()

  • MongoDB\Collection::getWriteConcern()

  • MongoDB\Database::getWriteConcern()

  • MongoDB\GridFS\Bucket::getWriteConcern()

Back

getTypeMap()