Navigation
This version of the documentation is archived and no longer supported. To learn how to upgrade your version of PHP Library Manual, refer to the upgrade documentation.

MongoDB\Client::getWriteConcern()

New in version 1.2.

Definition

MongoDB\Client::getWriteConcern

Returns the write concern for this client.

function getWriteConcern(): MongoDB\Driver\WriteConcern

Return Values

A MongoDB\Driver\WriteConcern object.

Example

<?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)
}