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\GridFSBucket::getWriteConcern()

New in version 1.2.

Definition

MongoDB\GridFS\Bucket::getWriteConcern

Returns the write concern for this GridFS bucket.

function getWriteConcern(): MongoDB\Driver\WriteConcern

Return Values

A MongoDB\Driver\WriteConcern object.

Example

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