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

MongoDB\Driver\BulkWriteCommandResult::getUpdateResults

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

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

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

mongodb-driver-bulkwritecommandresult.getupdateresults.php

MongoDB\Driver\BulkWriteCommandResult::getUpdateResults

(mongodb >=2.1.0)

MongoDB\Driver\BulkWriteCommandResult::getUpdateResultsReturns verbose results for successful updates

= NULL

final public MongoDB\Driver\BulkWriteCommandResult::getUpdateResults(): ?MongoDB\BSON\Document

Параметри

Оваа функција нема параметри.

Вратени вредности

Returns a document containing the result of each successful update operation, or null if verbose results were not requested. The document keys will correspond to the index of the write operation from MongoDB\Driver\BulkWriteCommand.

Errors/Exceptions

Примери

Пример #1 MongoDB\Driver\BulkWriteCommandResult::getUpsertedCount() example

<?php

$manager
= new MongoDB\Driver\Manager;

$bulk = new MongoDB\Driver\BulkWriteCommand(['verboseResults' => true]);
$bulk->insertOne('db.coll', ['x' => 1]);
$bulk->updateOne('db.coll', ['x' => 1], ['$set' => ['y' => 3]]);
$bulk->updateOne('db.coll', ['x' => 2], ['$set' => ['y' => 1]], ['upsert' => true]);
$bulk->updateOne('db.coll', ['x' => 3], ['$set' => ['y' => 2]], ['upsert' => true]);
$bulk->deleteMany('db.coll', []);

$result = $manager->executeBulkWriteCommand($bulk);

var_dump($result->getUpdateResults()->toPHP());

?>

Горниот пример ќе прикаже нешто слично на:

object(stdClass)#16 (3) {
  ["1"]=>
  object(stdClass)#7 (2) {
    ["matchedCount"]=>
    object(MongoDB\BSON\Int64)#5 (1) {
      ["integer"]=>
      string(1) "1"
    }
    ["modifiedCount"]=>
    object(MongoDB\BSON\Int64)#6 (1) {
      ["integer"]=>
      string(1) "1"
    }
  }
  ["2"]=>
  object(stdClass)#11 (3) {
    ["matchedCount"]=>
    object(MongoDB\BSON\Int64)#8 (1) {
      ["integer"]=>
      string(1) "1"
    }
    ["modifiedCount"]=>
    object(MongoDB\BSON\Int64)#9 (1) {
      ["integer"]=>
      string(1) "0"
    }
    ["upsertedId"]=>
    object(MongoDB\BSON\ObjectId)#10 (1) {
      ["oid"]=>
      string(24) "67f7eb9b1f198bbcb880d575"
    }
  }
  ["3"]=>
  object(stdClass)#15 (3) {
    ["matchedCount"]=>
    object(MongoDB\BSON\Int64)#12 (1) {
      ["integer"]=>
      string(1) "1"
    }
    ["modifiedCount"]=>
    object(MongoDB\BSON\Int64)#13 (1) {
      ["integer"]=>
      string(1) "0"
    }
    ["upsertedId"]=>
    object(MongoDB\BSON\ObjectId)#14 (1) {
      ["oid"]=>
      string(24) "67f7eb9b1f198bbcb880d576"
    }
  }
}

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

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

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

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

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

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

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

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