apiargs-MongoDBCollection-method-bulkWrite-param.yaml 1.26 KB
Newer Older
1 2 3 4
arg_name: param
name: $operations
type: array
description: |
5 6 7 8 9 10 11 12 13 14
  An array containing the write operations to perform.
  :phpmethod:`MongoDB\\Collection::bulkWrite()` supports
  :phpmethod:`deleteMany() <MongoDB\\Collection::deleteMany>`,
  :phpmethod:`deleteOne() <MongoDB\\Collection::deleteOne>`,
  :phpmethod:`insertOne() <MongoDB\\Collection::insertOne>`,
  :phpmethod:`replaceOne() <MongoDB\\Collection::replaceOne>`,
  :phpmethod:`updateMany() <MongoDB\\Collection::updateMany>`, and
  :phpmethod:`updateOne() <MongoDB\\Collection::updateOne>` operations in the
  following array structure:

15
  .. code-block:: php
16

17 18 19 20 21 22 23 24
     [
         [ 'deleteMany' => [ $filter ] ],
         [ 'deleteOne'  => [ $filter ] ],
         [ 'insertOne'  => [ $document ] ],
         [ 'replaceOne' => [ $filter, $replacement, $options ] ],
         [ 'updateMany' => [ $filter, $update, $options ] ],
         [ 'updateOne'  => [ $filter, $update, $options ] ],
     ]
25

26 27 28 29
  Arguments correspond to the respective operation methods. However, the
  ``writeConcern`` option is specified as a top-level option to
  :phpmethod:`MongoDB\\Collection::bulkWrite()` instead of each individual
  operation.
30
interface: phpmethod
31
operation: ~
32 33 34 35
optional: true
---
source:
  file: apiargs-common-param.yaml
36 37
  ref: $options
...