...

Text file src/go.mongodb.org/mongo-driver/testdata/crud/unified/updateOne-errorResponse.json

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

     1{
     2  "description": "updateOne-errorResponse",
     3  "schemaVersion": "1.12",
     4  "createEntities": [
     5    {
     6      "client": {
     7        "id": "client0",
     8        "useMultipleMongoses": false
     9      }
    10    },
    11    {
    12      "database": {
    13        "id": "database0",
    14        "client": "client0",
    15        "databaseName": "crud-tests"
    16      }
    17    },
    18    {
    19      "collection": {
    20        "id": "collection0",
    21        "database": "database0",
    22        "collectionName": "test"
    23      }
    24    }
    25  ],
    26  "tests": [
    27    {
    28      "description": "update operations support errorResponse assertions",
    29      "runOnRequirements": [
    30        {
    31          "minServerVersion": "4.0.0",
    32          "topologies": [
    33            "single",
    34            "replicaset"
    35          ]
    36        },
    37        {
    38          "minServerVersion": "4.2.0",
    39          "topologies": [
    40            "sharded"
    41          ]
    42        }
    43      ],
    44      "operations": [
    45        {
    46          "name": "failPoint",
    47          "object": "testRunner",
    48          "arguments": {
    49            "client": "client0",
    50            "failPoint": {
    51              "configureFailPoint": "failCommand",
    52              "mode": {
    53                "times": 1
    54              },
    55              "data": {
    56                "failCommands": [
    57                  "update"
    58                ],
    59                "errorCode": 8
    60              }
    61            }
    62          }
    63        },
    64        {
    65          "name": "updateOne",
    66          "object": "collection0",
    67          "arguments": {
    68            "filter": {
    69              "_id": 1
    70            },
    71            "update": {
    72              "$set": {
    73                "x": 1
    74              }
    75            }
    76          },
    77          "expectError": {
    78            "errorCode": 8,
    79            "errorResponse": {
    80              "code": 8
    81            }
    82          }
    83        }
    84      ]
    85    }
    86  ]
    87}

View as plain text