update : 2015.11.03
php.shukuma.com

검색:
 
 
Set the write concern for this connection

MongoClient::setWriteConcern

(PECL mongo >=1.5.0)

MongoClient::setWriteConcernSet the write concern for this connection

설명

public bool MongoClient::setWriteConcern ( mixed $w [, int $wtimeout ] )

인수

w

The write concern. This may be an integer denoting the number of servers required to acknowledge the write, or a string mode (e.g. "majority").

wtimeout

The maximum number of milliseconds to wait for the server to satisfy the write concern.

반환값

Returns TRUE on success, or FALSE otherwise.

오류/예외

Emits E_WARNING if the w parameter is not an integer or string value.

예제

Example #1 MongoClient::setWriteConcern() example

<?php

$mc 
= new MongoClient('mongodb://rs1.example.com,rs2.example.com');

// Require that the majority of servers in the replica set acknowledge writes
// within three seconds.
$mc->setWriteConcern('majority'3000);
?>

참고