...

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

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

     1{
     2  "description": "command",
     3  "schemaVersion": "1.0",
     4  "createEntities": [
     5    {
     6      "client": {
     7        "id": "client",
     8        "observeEvents": [
     9          "commandStartedEvent",
    10          "commandSucceededEvent",
    11          "commandFailedEvent"
    12        ]
    13      }
    14    },
    15    {
    16      "database": {
    17        "id": "database",
    18        "client": "client",
    19        "databaseName": "command-monitoring-tests"
    20      }
    21    },
    22    {
    23      "collection": {
    24        "id": "collection",
    25        "database": "database",
    26        "collectionName": "test"
    27      }
    28    }
    29  ],
    30  "initialData": [
    31    {
    32      "collectionName": "test",
    33      "databaseName": "command-monitoring-tests",
    34      "documents": [
    35        {
    36          "_id": 1,
    37          "x": 11
    38        }
    39      ]
    40    }
    41  ],
    42  "tests": [
    43    {
    44      "description": "A successful command",
    45      "operations": [
    46        {
    47          "name": "runCommand",
    48          "object": "database",
    49          "arguments": {
    50            "command": {
    51              "ping": 1
    52            },
    53            "commandName": "ping"
    54          }
    55        }
    56      ],
    57      "expectEvents": [
    58        {
    59          "client": "client",
    60          "events": [
    61            {
    62              "commandStartedEvent": {
    63                "command": {
    64                  "ping": 1
    65                },
    66                "commandName": "ping",
    67                "databaseName": "command-monitoring-tests"
    68              }
    69            },
    70            {
    71              "commandSucceededEvent": {
    72                "reply": {
    73                  "ok": 1
    74                },
    75                "commandName": "ping"
    76              }
    77            }
    78          ]
    79        }
    80      ]
    81    }
    82  ]
    83}

View as plain text