...

Text file src/go.mongodb.org/mongo-driver/testdata/crud/unified/insertMany-comment.json

Documentation: go.mongodb.org/mongo-driver/testdata/crud/unified

     1{
     2  "description": "insertMany-comment",
     3  "schemaVersion": "1.0",
     4  "createEntities": [
     5    {
     6      "client": {
     7        "id": "client0",
     8        "observeEvents": [
     9          "commandStartedEvent"
    10        ]
    11      }
    12    },
    13    {
    14      "database": {
    15        "id": "database0",
    16        "client": "client0",
    17        "databaseName": "crud-tests"
    18      }
    19    },
    20    {
    21      "collection": {
    22        "id": "collection0",
    23        "database": "database0",
    24        "collectionName": "coll0"
    25      }
    26    }
    27  ],
    28  "initialData": [
    29    {
    30      "collectionName": "coll0",
    31      "databaseName": "crud-tests",
    32      "documents": [
    33        {
    34          "_id": 1,
    35          "x": 11
    36        }
    37      ]
    38    }
    39  ],
    40  "tests": [
    41    {
    42      "description": "insertMany with string comment",
    43      "runOnRequirements": [
    44        {
    45          "minServerVersion": "4.4"
    46        }
    47      ],
    48      "operations": [
    49        {
    50          "name": "insertMany",
    51          "object": "collection0",
    52          "arguments": {
    53            "documents": [
    54              {
    55                "_id": 2,
    56                "x": 22
    57              }
    58            ],
    59            "comment": "comment"
    60          }
    61        }
    62      ],
    63      "expectEvents": [
    64        {
    65          "client": "client0",
    66          "events": [
    67            {
    68              "commandStartedEvent": {
    69                "command": {
    70                  "insert": "coll0",
    71                  "documents": [
    72                    {
    73                      "_id": 2,
    74                      "x": 22
    75                    }
    76                  ],
    77                  "comment": "comment"
    78                }
    79              }
    80            }
    81          ]
    82        }
    83      ],
    84      "outcome": [
    85        {
    86          "collectionName": "coll0",
    87          "databaseName": "crud-tests",
    88          "documents": [
    89            {
    90              "_id": 1,
    91              "x": 11
    92            },
    93            {
    94              "_id": 2,
    95              "x": 22
    96            }
    97          ]
    98        }
    99      ]
   100    },
   101    {
   102      "description": "insertMany with document comment",
   103      "runOnRequirements": [
   104        {
   105          "minServerVersion": "4.4"
   106        }
   107      ],
   108      "operations": [
   109        {
   110          "name": "insertMany",
   111          "object": "collection0",
   112          "arguments": {
   113            "documents": [
   114              {
   115                "_id": 2,
   116                "x": 22
   117              }
   118            ],
   119            "comment": {
   120              "key": "value"
   121            }
   122          }
   123        }
   124      ],
   125      "expectEvents": [
   126        {
   127          "client": "client0",
   128          "events": [
   129            {
   130              "commandStartedEvent": {
   131                "command": {
   132                  "insert": "coll0",
   133                  "documents": [
   134                    {
   135                      "_id": 2,
   136                      "x": 22
   137                    }
   138                  ],
   139                  "comment": {
   140                    "key": "value"
   141                  }
   142                }
   143              }
   144            }
   145          ]
   146        }
   147      ],
   148      "outcome": [
   149        {
   150          "collectionName": "coll0",
   151          "databaseName": "crud-tests",
   152          "documents": [
   153            {
   154              "_id": 1,
   155              "x": 11
   156            },
   157            {
   158              "_id": 2,
   159              "x": 22
   160            }
   161          ]
   162        }
   163      ]
   164    },
   165    {
   166      "description": "insertMany with comment - pre 4.4",
   167      "runOnRequirements": [
   168        {
   169          "minServerVersion": "3.4.0",
   170          "maxServerVersion": "4.2.99"
   171        }
   172      ],
   173      "operations": [
   174        {
   175          "name": "insertMany",
   176          "object": "collection0",
   177          "arguments": {
   178            "documents": [
   179              {
   180                "_id": 2,
   181                "x": 22
   182              }
   183            ],
   184            "comment": "comment"
   185          },
   186          "expectError": {
   187            "isClientError": false
   188          }
   189        }
   190      ],
   191      "expectEvents": [
   192        {
   193          "client": "client0",
   194          "events": [
   195            {
   196              "commandStartedEvent": {
   197                "command": {
   198                  "insert": "coll0",
   199                  "documents": [
   200                    {
   201                      "_id": 2,
   202                      "x": 22
   203                    }
   204                  ],
   205                  "comment": "comment"
   206                }
   207              }
   208            }
   209          ]
   210        }
   211      ],
   212      "outcome": [
   213        {
   214          "collectionName": "coll0",
   215          "databaseName": "crud-tests",
   216          "documents": [
   217            {
   218              "_id": 1,
   219              "x": 11
   220            }
   221          ]
   222        }
   223      ]
   224    }
   225  ]
   226}

View as plain text