...

Text file src/go.mongodb.org/mongo-driver/testdata/command-monitoring/unacknowledgedBulkWrite.yml

Documentation: go.mongodb.org/mongo-driver/testdata/command-monitoring

     1description: "unacknowledgedBulkWrite"
     2
     3schemaVersion: "1.0"
     4
     5createEntities:
     6  - client:
     7      id: &client client
     8      observeEvents:
     9        - commandStartedEvent
    10        - commandSucceededEvent
    11        - commandFailedEvent
    12  - database:
    13      id: &database database
    14      client: *client
    15      databaseName: &databaseName command-monitoring-tests
    16  - collection:
    17      id: &collection collection
    18      database: *database
    19      collectionName: &collectionName test
    20      collectionOptions:
    21        writeConcern: { w: 0 }
    22
    23initialData:
    24  - collectionName: *collectionName
    25    databaseName: *databaseName
    26    documents:
    27      - { _id: 1, x: 11 }
    28
    29tests:
    30  - description: "A successful unordered bulk write with an unacknowledged write concern"
    31    operations:
    32      - name: bulkWrite
    33        object: *collection
    34        arguments:
    35          requests:
    36            - insertOne:
    37                document: { _id: "unorderedBulkWriteInsertW0", x: 44 }
    38          ordered: false
    39    expectEvents:
    40      - client: *client
    41        events:
    42          - commandStartedEvent:
    43              command:
    44                insert: *collectionName
    45                documents:
    46                  - { _id: "unorderedBulkWriteInsertW0", x: 44 }
    47                ordered: false
    48                writeConcern: { w: 0 }
    49              commandName: insert
    50              databaseName: *databaseName
    51          - commandSucceededEvent:
    52              reply:
    53                ok: 1
    54                n: { $$exists: false }
    55              commandName: insert

View as plain text