...

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

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

     1description: "replaceOne-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
    24tests:
    25  - description: "ReplaceOne prohibits atomic modifiers"
    26    operations:
    27      - name: replaceOne
    28        object: *collection0
    29        arguments:
    30          filter: { _id: 1 }
    31          replacement: { $set: { x: 22 } }
    32        expectError:
    33          isClientError: true
    34    expectEvents:
    35      - client: *client0
    36        events: []
    37    outcome: *initialData

View as plain text