...

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

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

     1{
     2  "description": "driver-connection-id",
     3  "schemaVersion": "1.13",
     4  "createEntities": [
     5    {
     6      "client": {
     7        "id": "client",
     8        "observeLogMessages": {
     9          "command": "debug"
    10        }
    11      }
    12    },
    13    {
    14      "database": {
    15        "id": "database",
    16        "client": "client",
    17        "databaseName": "logging-tests"
    18      }
    19    },
    20    {
    21      "collection": {
    22        "id": "collection",
    23        "database": "database",
    24        "collectionName": "logging-tests-collection"
    25      }
    26    }
    27  ],
    28  "initialData": [
    29    {
    30      "collectionName": "logging-tests-collection",
    31      "databaseName": "logging-tests",
    32      "documents": [
    33        {
    34          "_id": 1,
    35          "x": 11
    36        }
    37      ]
    38    }
    39  ],
    40  "tests": [
    41    {
    42      "description": "A successful command",
    43      "operations": [
    44        {
    45          "name": "runCommand",
    46          "object": "database",
    47          "arguments": {
    48            "command": {
    49              "ping": 1
    50            },
    51            "commandName": "ping"
    52          }
    53        }
    54      ],
    55      "expectLogMessages": [
    56        {
    57          "client": "client",
    58          "messages": [
    59            {
    60              "level": "debug",
    61              "component": "command",
    62              "data": {
    63                "message": "Command started",
    64                "databaseName": "logging-tests",
    65                "commandName": "ping",
    66                "driverConnectionId": {
    67                  "$$type": [
    68                    "int",
    69                    "long"
    70                  ]
    71                }
    72              }
    73            },
    74            {
    75              "level": "debug",
    76              "component": "command",
    77              "data": {
    78                "message": "Command succeeded",
    79                "commandName": "ping",
    80                "driverConnectionId": {
    81                  "$$type": [
    82                    "int",
    83                    "long"
    84                  ]
    85                }
    86              }
    87            }
    88          ]
    89        }
    90      ]
    91    },
    92    {
    93      "description": "A failed command",
    94      "operations": [
    95        {
    96          "name": "find",
    97          "object": "collection",
    98          "arguments": {
    99            "filter": {
   100              "$or": true
   101            }
   102          },
   103          "expectError": {
   104            "isClientError": false
   105          }
   106        }
   107      ],
   108      "expectLogMessages": [
   109        {
   110          "client": "client",
   111          "messages": [
   112            {
   113              "level": "debug",
   114              "component": "command",
   115              "data": {
   116                "message": "Command started",
   117                "databaseName": "logging-tests",
   118                "commandName": "find",
   119                "driverConnectionId": {
   120                  "$$type": [
   121                    "int",
   122                    "long"
   123                  ]
   124                }
   125              }
   126            },
   127            {
   128              "level": "debug",
   129              "component": "command",
   130              "data": {
   131                "message": "Command failed",
   132                "commandName": "find",
   133                "driverConnectionId": {
   134                  "$$type": [
   135                    "int",
   136                    "long"
   137                  ]
   138                }
   139              }
   140            }
   141          ]
   142        }
   143      ]
   144    }
   145  ]
   146}

View as plain text