|
| 1 | +<?xml version="1.0" encoding="utf-8"?> |
| 2 | +<!-- $Revision$ --> |
| 3 | + |
| 4 | +<refentry xml:id="mongodb-driver-bulkwritecommandresult.getdeleteresults" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> |
| 5 | + <refnamediv> |
| 6 | + <refname>MongoDB\Driver\BulkWriteCommandResult::getDeleteResults</refname> |
| 7 | + <refpurpose>Returns verbose results for successful deletes</refpurpose> |
| 8 | + </refnamediv> |
| 9 | + |
| 10 | + <refsect1 role="description"> |
| 11 | + &reftitle.description; |
| 12 | + <methodsynopsis> |
| 13 | + <modifier>final</modifier> <modifier>public</modifier> <type class="union"><type>MongoDB\BSON\Document</type><type>null</type></type><methodname>MongoDB\Driver\BulkWriteCommandResult::getDeleteResults</methodname> |
| 14 | + <void /> |
| 15 | + </methodsynopsis> |
| 16 | + <para> |
| 17 | + </para> |
| 18 | + </refsect1> |
| 19 | + |
| 20 | + <refsect1 role="parameters"> |
| 21 | + &reftitle.parameters; |
| 22 | + &no.function.parameters; |
| 23 | + </refsect1> |
| 24 | + |
| 25 | + <refsect1 role="returnvalues"> |
| 26 | + &reftitle.returnvalues; |
| 27 | + <para> |
| 28 | + Returns a document containing the result of each successful delete |
| 29 | + operation, or &null; if verbose results were not requested. The document |
| 30 | + keys will correspond to the index of the write operation from |
| 31 | + <classname>MongoDB\Driver\BulkWriteCommand</classname>. |
| 32 | + </para> |
| 33 | + </refsect1> |
| 34 | + |
| 35 | + <refsect1 role="errors"> |
| 36 | + &reftitle.errors; |
| 37 | + <simplelist> |
| 38 | + &mongodb.throws.argumentparsing; |
| 39 | + &mongodb.throws.unacknowledged; |
| 40 | + </simplelist> |
| 41 | + </refsect1> |
| 42 | + |
| 43 | + <refsect1 role="examples"> |
| 44 | + &reftitle.examples; |
| 45 | + <example> |
| 46 | + <title><function>MongoDB\Driver\BulkWriteCommandResult::getDeleteResults</function> example</title> |
| 47 | + <programlisting role="php"> |
| 48 | +<![CDATA[ |
| 49 | +<?php |
| 50 | +
|
| 51 | +$manager = new MongoDB\Driver\Manager; |
| 52 | +
|
| 53 | +$bulk = new MongoDB\Driver\BulkWriteCommand(['verboseResults' => true]); |
| 54 | +$bulk->insertOne('db.coll', ['x' => 1]); |
| 55 | +$bulk->updateOne('db.coll', ['x' => 1], ['$set' => ['y' => 3]]); |
| 56 | +$bulk->updateOne('db.coll', ['x' => 2], ['$set' => ['y' => 1]], ['upsert' => true]); |
| 57 | +$bulk->updateOne('db.coll', ['x' => 3], ['$set' => ['y' => 2]], ['upsert' => true]); |
| 58 | +$bulk->deleteMany('db.coll', []); |
| 59 | +
|
| 60 | +$result = $manager->executeBulkWriteCommand($bulk); |
| 61 | +
|
| 62 | +var_dump($result->getDeleteResults()->toPHP()); |
| 63 | +
|
| 64 | +?> |
| 65 | +]]> |
| 66 | + </programlisting> |
| 67 | + &example.outputs.similar; |
| 68 | + <screen> |
| 69 | +<![CDATA[ |
| 70 | +object(stdClass)#7 (1) { |
| 71 | + ["4"]=> |
| 72 | + object(stdClass)#6 (1) { |
| 73 | + ["deletedCount"]=> |
| 74 | + object(MongoDB\BSON\Int64)#5 (1) { |
| 75 | + ["integer"]=> |
| 76 | + string(1) "3" |
| 77 | + } |
| 78 | + } |
| 79 | +} |
| 80 | +]]> |
| 81 | + </screen> |
| 82 | + </example> |
| 83 | + </refsect1> |
| 84 | + |
| 85 | + <refsect1 role="seealso"> |
| 86 | + &reftitle.seealso; |
| 87 | + <simplelist> |
| 88 | + <member><methodname>MongoDB\Driver\BulkWriteCommandResult::getDeletedCount</methodname></member> |
| 89 | + <member><methodname>MongoDB\Driver\BulkWriteCommandResult::isAcknowledged</methodname></member> |
| 90 | + </simplelist> |
| 91 | + </refsect1> |
| 92 | + |
| 93 | +</refentry> |
| 94 | + |
| 95 | +<!-- Keep this comment at the end of the file |
| 96 | +Local variables: |
| 97 | +mode: sgml |
| 98 | +sgml-omittag:t |
| 99 | +sgml-shorttag:t |
| 100 | +sgml-minimize-attributes:nil |
| 101 | +sgml-always-quote-attributes:t |
| 102 | +sgml-indent-step:1 |
| 103 | +sgml-indent-data:t |
| 104 | +indent-tabs-mode:nil |
| 105 | +sgml-parent-document:nil |
| 106 | +sgml-default-dtd-file:"~/.phpdoc/manual.ced" |
| 107 | +sgml-exposed-tags:nil |
| 108 | +sgml-local-catalogs:nil |
| 109 | +sgml-local-ecat-files:nil |
| 110 | +End: |
| 111 | +vim600: syn=xml fen fdm=syntax fdl=2 si |
| 112 | +vim: et tw=78 syn=sgml |
| 113 | +vi: ts=1 sw=1 |
| 114 | +--> |
0 commit comments