...

Text file src/go.mongodb.org/mongo-driver/testdata/crud/unified/bulkWrite-update-hint-clientError.json

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

     1{
     2  "description": "bulkWrite-update-hint-clientError",
     3  "schemaVersion": "1.0",
     4  "runOnRequirements": [
     5    {
     6      "maxServerVersion": "3.3.99"
     7    }
     8  ],
     9  "createEntities": [
    10    {
    11      "client": {
    12        "id": "client0",
    13        "observeEvents": [
    14          "commandStartedEvent"
    15        ]
    16      }
    17    },
    18    {
    19      "database": {
    20        "id": "database0",
    21        "client": "client0",
    22        "databaseName": "crud-v2"
    23      }
    24    },
    25    {
    26      "collection": {
    27        "id": "collection0",
    28        "database": "database0",
    29        "collectionName": "test_bulkwrite_update_hint"
    30      }
    31    }
    32  ],
    33  "initialData": [
    34    {
    35      "collectionName": "test_bulkwrite_update_hint",
    36      "databaseName": "crud-v2",
    37      "documents": [
    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          "_id": 4,
    52          "x": 44
    53        }
    54      ]
    55    }
    56  ],
    57  "tests": [
    58    {
    59      "description": "BulkWrite updateOne with update hints unsupported (client-side error)",
    60      "operations": [
    61        {
    62          "object": "collection0",
    63          "name": "bulkWrite",
    64          "arguments": {
    65            "requests": [
    66              {
    67                "updateOne": {
    68                  "filter": {
    69                    "_id": 1
    70                  },
    71                  "update": {
    72                    "$inc": {
    73                      "x": 1
    74                    }
    75                  },
    76                  "hint": "_id_"
    77                }
    78              },
    79              {
    80                "updateOne": {
    81                  "filter": {
    82                    "_id": 1
    83                  },
    84                  "update": {
    85                    "$inc": {
    86                      "x": 1
    87                    }
    88                  },
    89                  "hint": {
    90                    "_id": 1
    91                  }
    92                }
    93              }
    94            ],
    95            "ordered": true
    96          },
    97          "expectError": {
    98            "isError": true
    99          }
   100        }
   101      ],
   102      "expectEvents": [
   103        {
   104          "client": "client0",
   105          "events": []
   106        }
   107      ],
   108      "outcome": [
   109        {
   110          "collectionName": "test_bulkwrite_update_hint",
   111          "databaseName": "crud-v2",
   112          "documents": [
   113            {
   114              "_id": 1,
   115              "x": 11
   116            },
   117            {
   118              "_id": 2,
   119              "x": 22
   120            },
   121            {
   122              "_id": 3,
   123              "x": 33
   124            },
   125            {
   126              "_id": 4,
   127              "x": 44
   128            }
   129          ]
   130        }
   131      ]
   132    },
   133    {
   134      "description": "BulkWrite updateMany with update hints unsupported (client-side error)",
   135      "operations": [
   136        {
   137          "object": "collection0",
   138          "name": "bulkWrite",
   139          "arguments": {
   140            "requests": [
   141              {
   142                "updateMany": {
   143                  "filter": {
   144                    "_id": {
   145                      "$lt": 3
   146                    }
   147                  },
   148                  "update": {
   149                    "$inc": {
   150                      "x": 1
   151                    }
   152                  },
   153                  "hint": "_id_"
   154                }
   155              },
   156              {
   157                "updateMany": {
   158                  "filter": {
   159                    "_id": {
   160                      "$lt": 3
   161                    }
   162                  },
   163                  "update": {
   164                    "$inc": {
   165                      "x": 1
   166                    }
   167                  },
   168                  "hint": {
   169                    "_id": 1
   170                  }
   171                }
   172              }
   173            ],
   174            "ordered": true
   175          },
   176          "expectError": {
   177            "isError": true
   178          }
   179        }
   180      ],
   181      "expectEvents": [
   182        {
   183          "client": "client0",
   184          "events": []
   185        }
   186      ],
   187      "outcome": [
   188        {
   189          "collectionName": "test_bulkwrite_update_hint",
   190          "databaseName": "crud-v2",
   191          "documents": [
   192            {
   193              "_id": 1,
   194              "x": 11
   195            },
   196            {
   197              "_id": 2,
   198              "x": 22
   199            },
   200            {
   201              "_id": 3,
   202              "x": 33
   203            },
   204            {
   205              "_id": 4,
   206              "x": 44
   207            }
   208          ]
   209        }
   210      ]
   211    },
   212    {
   213      "description": "BulkWrite replaceOne with update hints unsupported (client-side error)",
   214      "operations": [
   215        {
   216          "object": "collection0",
   217          "name": "bulkWrite",
   218          "arguments": {
   219            "requests": [
   220              {
   221                "replaceOne": {
   222                  "filter": {
   223                    "_id": 3
   224                  },
   225                  "replacement": {
   226                    "x": 333
   227                  },
   228                  "hint": "_id_"
   229                }
   230              },
   231              {
   232                "replaceOne": {
   233                  "filter": {
   234                    "_id": 4
   235                  },
   236                  "replacement": {
   237                    "x": 444
   238                  },
   239                  "hint": {
   240                    "_id": 1
   241                  }
   242                }
   243              }
   244            ],
   245            "ordered": true
   246          },
   247          "expectError": {
   248            "isError": true
   249          }
   250        }
   251      ],
   252      "expectEvents": [
   253        {
   254          "client": "client0",
   255          "events": []
   256        }
   257      ],
   258      "outcome": [
   259        {
   260          "collectionName": "test_bulkwrite_update_hint",
   261          "databaseName": "crud-v2",
   262          "documents": [
   263            {
   264              "_id": 1,
   265              "x": 11
   266            },
   267            {
   268              "_id": 2,
   269              "x": 22
   270            },
   271            {
   272              "_id": 3,
   273              "x": 33
   274            },
   275            {
   276              "_id": 4,
   277              "x": 44
   278            }
   279          ]
   280        }
   281      ]
   282    }
   283  ]
   284}

View as plain text