...

Text file src/go.mongodb.org/mongo-driver/testdata/command-monitoring/logging/unacknowledged-write.yml

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

     1description: "unacknowledged-write"
     2
     3schemaVersion: "1.13"
     4
     5createEntities:
     6  - client:
     7      id: &client client
     8      observeLogMessages:
     9        command: debug
    10  - database:
    11      id: &database database
    12      client: *client
    13      databaseName: &databaseName logging-tests
    14  - collection:
    15      id: &collection collection
    16      database: *database
    17      collectionName: &collectionName logging-tests-collection
    18      collectionOptions:
    19        writeConcern: { w: 0 }
    20
    21initialData:
    22  - collectionName: *collectionName
    23    databaseName: *databaseName
    24    documents:
    25      - { _id: 1 }
    26
    27tests:
    28  - description: "An unacknowledged write generates a succeeded log message with ok: 1 reply"
    29    operations:
    30      - name: insertOne
    31        object: *collection
    32        arguments:
    33          document: { _id: 2 }
    34    expectLogMessages:
    35      - client: *client
    36        messages:
    37          - level: debug
    38            component: command
    39            data:
    40              message: "Command started"
    41              databaseName: *databaseName
    42              commandName: insert
    43              command:
    44                $$matchAsDocument:
    45                  $$matchAsRoot:
    46                    insert: *collectionName
    47                    $db: *databaseName
    48              requestId: { $$type: [int, long] }
    49              serverHost: { $$type: string }
    50              serverPort: { $$type: [int, long] }
    51
    52          - level: debug
    53            component: command
    54            data:
    55              message: "Command succeeded"
    56              commandName: insert
    57              reply:
    58                $$matchAsDocument:
    59                  ok: 1
    60              requestId: { $$type: [int, long] }
    61              serverHost: { $$type: string }
    62              serverPort: { $$type: [int, long] }
    63              durationMS: { $$type: [double, int, long] }

View as plain text