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 the mongodb driver writeconcern classphp mongodb driver monitoring commandfailedevent returns the exception associated with the failed commandphp mongodb driver monitoring commandfailedevent returns the command s operation idphp mongodb driver monitoring commandfailedevent returns the command reply documentphp mongodb driver monitoring commandsucceededevent returns the command s operation idphp mongodb driver monitoring commandsucceededevent returns the command reply documentphp mongodb driver monitoring commandsucceededevent returns the command s request 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 writeconcern returns an object for bson serializationphp mongodb driver writeconcern create a new writeconcernphp 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 writeresult returns the number of documents inserted excluding upserts php mongodb driver writeresult returns the number of documents selected for updatephp mongodb driver writeresult returns the number of existing documents updatedphp mongodb driver writeresult returns the server associated with this write result
关注编程学问公众号