...

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

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

     1{
     2  "description": "bulkWrite",
     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          "_id": 2,
    41          "x": 22
    42        },
    43        {
    44          "_id": 3,
    45          "x": 33
    46        }
    47      ]
    48    }
    49  ],
    50  "tests": [
    51    {
    52      "description": "A successful mixed bulk write",
    53      "operations": [
    54        {
    55          "name": "bulkWrite",
    56          "object": "collection",
    57          "arguments": {
    58            "requests": [
    59              {
    60                "insertOne": {
    61                  "document": {
    62                    "_id": 4,
    63                    "x": 44
    64                  }
    65                }
    66              },
    67              {
    68                "updateOne": {
    69                  "filter": {
    70                    "_id": 3
    71                  },
    72                  "update": {
    73                    "$set": {
    74                      "x": 333
    75                    }
    76                  }
    77                }
    78              }
    79            ]
    80          }
    81        }
    82      ],
    83      "expectEvents": [
    84        {
    85          "client": "client",
    86          "events": [
    87            {
    88              "commandStartedEvent": {
    89                "command": {
    90                  "insert": "test",
    91                  "documents": [
    92                    {
    93                      "_id": 4,
    94                      "x": 44
    95                    }
    96                  ],
    97                  "ordered": true
    98                },
    99                "commandName": "insert",
   100                "databaseName": "command-monitoring-tests"
   101              }
   102            },
   103            {
   104              "commandSucceededEvent": {
   105                "reply": {
   106                  "ok": 1,
   107                  "n": 1
   108                },
   109                "commandName": "insert"
   110              }
   111            },
   112            {
   113              "commandStartedEvent": {
   114                "command": {
   115                  "update": "test",
   116                  "updates": [
   117                    {
   118                      "q": {
   119                        "_id": 3
   120                      },
   121                      "u": {
   122                        "$set": {
   123                          "x": 333
   124                        }
   125                      },
   126                      "upsert": {
   127                        "$$unsetOrMatches": false
   128                      },
   129                      "multi": {
   130                        "$$unsetOrMatches": false
   131                      }
   132                    }
   133                  ],
   134                  "ordered": true
   135                },
   136                "commandName": "update",
   137                "databaseName": "command-monitoring-tests"
   138              }
   139            },
   140            {
   141              "commandSucceededEvent": {
   142                "reply": {
   143                  "ok": 1,
   144                  "n": 1
   145                },
   146                "commandName": "update"
   147              }
   148            }
   149          ]
   150        }
   151      ]
   152    }
   153  ]
   154}

View as plain text