...

Text file src/go.mongodb.org/mongo-driver/testdata/crud/unified/updateMany-comment.yml

Documentation: go.mongodb.org/mongo-driver/testdata/crud/unified

     1description: "updateMany-comment"
     2schemaVersion: "1.0"
     3
     4createEntities:
     5  - client:
     6      id: &client0 client0
     7      observeEvents: [ commandStartedEvent ]
     8  - database:
     9      id: &database0 database0
    10      client: *client0
    11      databaseName: &database0Name crud-tests
    12  - collection:
    13      id: &collection0 collection0
    14      database: *database0
    15      collectionName: &collection0Name coll0
    16
    17initialData: &initialData
    18  - collectionName: *collection0Name
    19    databaseName: *database0Name
    20    documents:
    21      - { _id: 1, x: 11 }
    22
    23tests:
    24  - description: "UpdateMany with string comment"
    25    runOnRequirements:
    26      - minServerVersion: "4.4"
    27    operations:
    28      - name: updateMany
    29        object: *collection0
    30        arguments:
    31          filter: &filter { _id: 1 }
    32          update: &update { $set: {x: 22} }
    33          comment: "comment"
    34    expectEvents:
    35      - client: *client0
    36        events:
    37          - commandStartedEvent:
    38              command:
    39                update: *collection0Name
    40                updates:
    41                  -
    42                    q: *filter
    43                    u: *update
    44                    multi: true
    45                    upsert: { $$unsetOrMatches: false }
    46                comment: "comment"
    47    outcome: &outcome
    48      - collectionName: *collection0Name
    49        databaseName: *database0Name
    50        documents:
    51          - { _id: 1, x: 22 }
    52
    53  - description: "UpdateMany with document comment"
    54    runOnRequirements:
    55      - minServerVersion: "4.4"
    56    operations:
    57      - name: updateMany
    58        object: *collection0
    59        arguments:
    60          filter: *filter
    61          update: *update
    62          comment: &comment { key: "value" }
    63    expectEvents:
    64      - client: *client0
    65        events:
    66          - commandStartedEvent:
    67              command:
    68                update: *collection0Name
    69                updates:
    70                  -
    71                    q: *filter
    72                    u: *update
    73                    multi: true
    74                    upsert: { $$unsetOrMatches: false }
    75                comment: *comment
    76    outcome: *outcome
    77
    78  - description: "UpdateMany with comment - pre 4.4"
    79    runOnRequirements:
    80      - minServerVersion: "3.4.0"
    81        maxServerVersion: "4.2.99"
    82    operations:
    83      - name: updateMany
    84        object: *collection0
    85        arguments:
    86          filter: *filter
    87          update: *update
    88          comment: "comment"
    89        expectError:
    90          isClientError: false
    91    expectEvents:
    92      - client: *client0
    93        events:
    94          - commandStartedEvent:
    95              command:
    96                update: *collection0Name
    97                updates:
    98                  -
    99                    q: *filter
   100                    u: *update
   101                    multi: true
   102                    upsert: { $$unsetOrMatches: false }
   103                comment: "comment"
   104    outcome: *initialData

View as plain text