MongoDB\Driver\WriteConcern::getW

(mongodb >=1.0.0)

MongoDB\Driver\WriteConcern::getWReturns the WriteConcern's "w" option

说明

final public MongoDB\Driver\WriteConcern::getW ( void ) : string|integer|null

参数

此函数没有参数。

返回值

Returns the WriteConcern's "w" option.

错误/异常

范例

Example #1 MongoDB\Driver\WriteConcern::getW() example

<?php

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

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

?>

以上例程会输出:

int(1)
string(8) "majority"
相关文章
php mongodb driver cursor returns an array containing all results for this cursorphp mongodb driver monitoring commandfailedevent returns the command namephp mongodb driver monitoring commandfailedevent returns the command s duration in microsecondsphp mongodb driver monitoring commandfailedevent returns the exception associated with the failed commandphp mongodb driver monitoring commandsucceededevent returns the command namephp mongodb driver monitoring commandsucceededevent returns the command s duration in microsecondsphp mongodb driver monitoring commandsucceededevent returns the command s operation idphp mongodb driver readconcern returns the readconcern s level optionphp mongodb driver readpreference returns the readpreference s maxstalenessseconds optionphp mongodb driver readpreference returns the readpreference s mode optionphp mongodb driver readpreference returns the readpreference s tagsets optionphp mongodb driver exception runtimeexception returns whether an error label is associated with an exceptionphp mongodb driver writeconcern returns an object for bson serializationphp mongodb driver writeconcern returns the writeconcern s journal optionphp mongodb driver writeconcern returns the writeconcern s w optionphp mongodb driver writeconcern returns the writeconcern s wtimeout optionphp mongodb driver writeerror returns the writeerror s error messagephp mongodb driver exception writeexception returns the writeresult for the failed write operationphp mongodb driver writeresult returns the number of documents deletedphp mongodb driver writeresult returns the number of documents inserted excluding upserts
关注编程学问公众号