...

Text file src/go.mongodb.org/mongo-driver/testdata/crud/v1/write/insertMany.json

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

     1{
     2  "data": [
     3    {
     4      "_id": 1,
     5      "x": 11
     6    }
     7  ],
     8  "tests": [
     9    {
    10      "description": "InsertMany with non-existing documents",
    11      "operation": {
    12        "name": "insertMany",
    13        "arguments": {
    14          "documents": [
    15            {
    16              "_id": 2,
    17              "x": 22
    18            },
    19            {
    20              "_id": 3,
    21              "x": 33
    22            }
    23          ],
    24          "options": {
    25            "ordered": true
    26          }
    27        }
    28      },
    29      "outcome": {
    30        "result": {
    31          "insertedIds": {
    32            "0": 2,
    33            "1": 3
    34          }
    35        },
    36        "collection": {
    37          "data": [
    38            {
    39              "_id": 1,
    40              "x": 11
    41            },
    42            {
    43              "_id": 2,
    44              "x": 22
    45            },
    46            {
    47              "_id": 3,
    48              "x": 33
    49            }
    50          ]
    51        }
    52      }
    53    },
    54    {
    55      "description": "InsertMany continue-on-error behavior with unordered (preexisting duplicate key)",
    56      "operation": {
    57        "name": "insertMany",
    58        "arguments": {
    59          "documents": [
    60            {
    61              "_id": 1,
    62              "x": 11
    63            },
    64            {
    65              "_id": 2,
    66              "x": 22
    67            },
    68            {
    69              "_id": 3,
    70              "x": 33
    71            }
    72          ],
    73          "options": {
    74            "ordered": false
    75          }
    76        }
    77      },
    78      "outcome": {
    79        "error": true,
    80        "result": {
    81          "deletedCount": 0,
    82          "insertedCount": 2,
    83          "matchedCount": 0,
    84          "modifiedCount": 0,
    85          "upsertedCount": 0,
    86          "upsertedIds": {}
    87        },
    88        "collection": {
    89          "data": [
    90            {
    91              "_id": 1,
    92              "x": 11
    93            },
    94            {
    95              "_id": 2,
    96              "x": 22
    97            },
    98            {
    99              "_id": 3,
   100              "x": 33
   101            }
   102          ]
   103        }
   104      }
   105    },
   106    {
   107      "description": "InsertMany continue-on-error behavior with unordered (duplicate key in requests)",
   108      "operation": {
   109        "name": "insertMany",
   110        "arguments": {
   111          "documents": [
   112            {
   113              "_id": 2,
   114              "x": 22
   115            },
   116            {
   117              "_id": 2,
   118              "x": 22
   119            },
   120            {
   121              "_id": 3,
   122              "x": 33
   123            }
   124          ],
   125          "options": {
   126            "ordered": false
   127          }
   128        }
   129      },
   130      "outcome": {
   131        "error": true,
   132        "result": {
   133          "deletedCount": 0,
   134          "insertedCount": 2,
   135          "matchedCount": 0,
   136          "modifiedCount": 0,
   137          "upsertedCount": 0,
   138          "upsertedIds": {}
   139        },
   140        "collection": {
   141          "data": [
   142            {
   143              "_id": 1,
   144              "x": 11
   145            },
   146            {
   147              "_id": 2,
   148              "x": 22
   149            },
   150            {
   151              "_id": 3,
   152              "x": 33
   153            }
   154          ]
   155        }
   156      }
   157    }
   158  ]
   159}

View as plain text