...

Text file src/go.mongodb.org/mongo-driver/testdata/retryable-writes/legacy/replaceOne.json

Documentation: go.mongodb.org/mongo-driver/testdata/retryable-writes/legacy

     1{
     2  "runOn": [
     3    {
     4      "minServerVersion": "3.6",
     5      "topology": [
     6        "replicaset"
     7      ]
     8    }
     9  ],
    10  "data": [
    11    {
    12      "_id": 1,
    13      "x": 11
    14    },
    15    {
    16      "_id": 2,
    17      "x": 22
    18    }
    19  ],
    20  "tests": [
    21    {
    22      "description": "ReplaceOne is committed on first attempt",
    23      "failPoint": {
    24        "configureFailPoint": "onPrimaryTransactionalWrite",
    25        "mode": {
    26          "times": 1
    27        }
    28      },
    29      "operation": {
    30        "name": "replaceOne",
    31        "arguments": {
    32          "filter": {
    33            "_id": 1
    34          },
    35          "replacement": {
    36            "_id": 1,
    37            "x": 111
    38          }
    39        }
    40      },
    41      "outcome": {
    42        "result": {
    43          "matchedCount": 1,
    44          "modifiedCount": 1,
    45          "upsertedCount": 0
    46        },
    47        "collection": {
    48          "data": [
    49            {
    50              "_id": 1,
    51              "x": 111
    52            },
    53            {
    54              "_id": 2,
    55              "x": 22
    56            }
    57          ]
    58        }
    59      }
    60    },
    61    {
    62      "description": "ReplaceOne is not committed on first attempt",
    63      "failPoint": {
    64        "configureFailPoint": "onPrimaryTransactionalWrite",
    65        "mode": {
    66          "times": 1
    67        },
    68        "data": {
    69          "failBeforeCommitExceptionCode": 1
    70        }
    71      },
    72      "operation": {
    73        "name": "replaceOne",
    74        "arguments": {
    75          "filter": {
    76            "_id": 1
    77          },
    78          "replacement": {
    79            "_id": 1,
    80            "x": 111
    81          }
    82        }
    83      },
    84      "outcome": {
    85        "result": {
    86          "matchedCount": 1,
    87          "modifiedCount": 1,
    88          "upsertedCount": 0
    89        },
    90        "collection": {
    91          "data": [
    92            {
    93              "_id": 1,
    94              "x": 111
    95            },
    96            {
    97              "_id": 2,
    98              "x": 22
    99            }
   100          ]
   101        }
   102      }
   103    },
   104    {
   105      "description": "ReplaceOne is never committed",
   106      "failPoint": {
   107        "configureFailPoint": "onPrimaryTransactionalWrite",
   108        "mode": {
   109          "times": 2
   110        },
   111        "data": {
   112          "failBeforeCommitExceptionCode": 1
   113        }
   114      },
   115      "operation": {
   116        "name": "replaceOne",
   117        "arguments": {
   118          "filter": {
   119            "_id": 1
   120          },
   121          "replacement": {
   122            "_id": 1,
   123            "x": 111
   124          }
   125        }
   126      },
   127      "outcome": {
   128        "error": true,
   129        "collection": {
   130          "data": [
   131            {
   132              "_id": 1,
   133              "x": 11
   134            },
   135            {
   136              "_id": 2,
   137              "x": 22
   138            }
   139          ]
   140        }
   141      }
   142    }
   143  ]
   144}

View as plain text