php8.5
Home/ Manual/ driver / writeconcern/ MongoDB\Driver\WriteConcern::getWtimeout

MongoDB\Driver\WriteConcern::getWtimeout

PHP function Edit on GitHub ✎

(mongodb >=1.0.0)

Returns the WriteConcern's "wtimeout" option

Description

MongoDB\Driver\WriteConcern::getWtimeout(): int

Parameters Parameters

Return Values

Returns the WriteConcern's "wtimeout" option.

Errors/Exceptions

Changelog

VersionDescription
PECL mongodb 1.7.0On 32-bit systems, this method will always truncate the wTimeout value if it exceeds the 32-bit range. In that case, a warning will be emitted.

Examples

MongoDB\Driver\WriteConcern::getWtimeout() example

php
<?php

$wc = new MongoDB\Driver\WriteConcern(1);
var_dump($wc->getWtimeout());

$wc = new MongoDB\Driver\WriteConcern(MongoDB\Driver\WriteConcern::MAJORITY, 3000);
var_dump($wc->getWtimeout());

?>

The above example will output:

output
int(0)
int(3000)

See Also

  • Write Concern reference

Source: reference/mongodb/mongodb/driver/writeconcern/getwtimeout.xml · from the official PHP manual (php/doc-en)