...

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

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

     1description: "updateMany-validation"
     2
     3schemaVersion: "1.0"
     4
     5createEntities:
     6  - client:
     7      id: &client0 client0
     8      observeEvents: [ commandStartedEvent ]
     9  - database:
    10      id: &database0 database0
    11      client: *client0
    12      databaseName: &database0Name crud-tests
    13  - collection:
    14      id: &collection0 collection0
    15      database: *database0
    16      collectionName: &collection0Name coll0
    17
    18initialData: &initialData
    19  - collectionName: *collection0Name
    20    databaseName: *database0Name
    21    documents:
    22      - { _id: 1, x: 11 }
    23      - { _id: 2, x: 22 }
    24      - { _id: 3, x: 33 }
    25
    26tests:
    27  - description: "UpdateMany requires atomic modifiers"
    28    operations:
    29      - name: updateMany
    30        object: *collection0
    31        arguments:
    32          filter: { _id: { $gt: 1 } }
    33          update: { x: 44 }
    34        expectError:
    35          isClientError: true
    36    expectEvents:
    37      - client: *client0
    38        events: []
    39    outcome: *initialData

View as plain text