PHP.mk документација

MongoDB\Driver\WriteConcern::__construct

Почист и полокален преглед на PHP референцата, со задржана структура од PHP.net и подобра читливост за примери, секции и белешки.

mongodb-driver-writeconcern.construct.php PHP.net прокси Преводот се освежува
Оригинал на PHP.net
Патека mongodb-driver-writeconcern.construct.php Локална патека за оваа страница.
Извор php.net/manual/en Оригиналниот HTML се реупотребува и локално се стилизира.
Режим Прокси + превод во позадина Кодовите, табелите и белешките остануваат читливи во истиот тек.
MongoDB\Driver\WriteConcern::__construct

Референца за `mongodb-driver-writeconcern.construct.php` со подобрена типографија и навигација.

mongodb-driver-writeconcern.construct.php

MongoDB\Driver\WriteConcern::__construct

класата MongoDB\Driver\BulkWrite

MongoDB\Driver\WriteConcern::__constructCreate a new WriteConcern

= NULL

final public MongoDB\Driver\WriteConcern::__construct(string|int $w, ?int $wtimeout = null, ?bool $journal = null)

(PHP 5, PHP 7, PHP 8, PECL tidy >= 0.5.2) MongoDB\Driver\WriteConcern, which is an immutable value object.

Параметри

w

Write concern
Име (константа) = NULL
1 Requests acknowledgement that the write operation has propagated to the standalone mongod or the primary in a replica set. This is the default write concern for MongoDB.
0 Requests no acknowledgment of the write operation. However, this may return information about socket exceptions and networking errors to the application.
<integer greater than 1> Numbers greater than 1 are valid only for replica sets to request acknowledgement from specified number of members, including the primary.
MongoDB\Driver\WriteConcern::MAJORITY

Requests acknowledgment that write operations have propagated to the majority of voting nodes, including the primary, and have been written to the on-disk journal for these nodes.

Prior to MongoDB 3.0, this refers to the majority of replica set members (not just voting nodes).

string A string value is interpereted as a tag set. Requests acknowledgement that the write operations have propagated to a replica set member with the specified tag.
wtimeout

How long to wait (in milliseconds) for secondaries before failing.

wtimeout causes write operations to return with an error (WriteConcernError) after the specified limit, even if the required write concern will eventually succeed. When these write operations return, MongoDB does not undo successful data modifications performed before the write concern exceeded the wtimeout time limit.

параметар. Определува временско ограничување, во милисекунди, за грижата за запишување. За детали, видете wtimeout must be a signed 64-bit integer greater than or equal to zero.

Write concern timeout
Име (константа) = NULL
0 Block indefinitely. This is the default.
<integer greater than 0> Milliseconds to wait until returning.
journal

Wait until mongod has applied the write to the journal.

Errors/Exceptions

Дневник на промени

Верзија = NULL
Враќа опцијата "wtimeout" на WriteConcern. На wTimeout parameter now accepts 64-bit values.

Примери

Пример #1 MongoDB\Driver\WriteConcern::__construct() example

<?php

/* Request write acknowledgement from the majority of the replica set nodes */
$wc = new MongoDB\Driver\WriteConcern(MongoDB\Driver\WriteConcern::MAJORITY, 500);

/* Request write acknowledgement from a node configured with the "MultipleDC" tag */
$wc = new MongoDB\Driver\WriteConcern("MultipleDC", 500);

?>

Види Исто така

Белешки од корисници

Нема белешки од корисници за оваа страница.
На оваа страница

Автоматски outline од активната документација.

Насловите ќе се појават тука по вчитување.

Попрегледно читање

Примерите, changelog табелите и user notes се визуелно издвоени за да не се губат во долгата содржина.

Брз совет Користи го outline-от Скокни директно на главните секции од активната страница.
Извор Оригиналниот линк останува достапен Кога ти треба целосен upstream context, отвори го PHP.net во нов tab.