...

Text file src/go.mongodb.org/mongo-driver/testdata/retryable-writes/legacy/findOneAndDelete.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": "FindOneAndDelete is committed on first attempt",
    23      "failPoint": {
    24        "configureFailPoint": "onPrimaryTransactionalWrite",
    25        "mode": {
    26          "times": 1
    27        }
    28      },
    29      "operation": {
    30        "name": "findOneAndDelete",
    31        "arguments": {
    32          "filter": {
    33            "x": {
    34              "$gte": 11
    35            }
    36          },
    37          "sort": {
    38            "x": 1
    39          }
    40        }
    41      },
    42      "outcome": {
    43        "result": {
    44          "_id": 1,
    45          "x": 11
    46        },
    47        "collection": {
    48          "data": [
    49            {
    50              "_id": 2,
    51              "x": 22
    52            }
    53          ]
    54        }
    55      }
    56    },
    57    {
    58      "description": "FindOneAndDelete is not committed on first attempt",
    59      "failPoint": {
    60        "configureFailPoint": "onPrimaryTransactionalWrite",
    61        "mode": {
    62          "times": 1
    63        },
    64        "data": {
    65          "failBeforeCommitExceptionCode": 1
    66        }
    67      },
    68      "operation": {
    69        "name": "findOneAndDelete",
    70        "arguments": {
    71          "filter": {
    72            "x": {
    73              "$gte": 11
    74            }
    75          },
    76          "sort": {
    77            "x": 1
    78          }
    79        }
    80      },
    81      "outcome": {
    82        "result": {
    83          "_id": 1,
    84          "x": 11
    85        },
    86        "collection": {
    87          "data": [
    88            {
    89              "_id": 2,
    90              "x": 22
    91            }
    92          ]
    93        }
    94      }
    95    },
    96    {
    97      "description": "FindOneAndDelete is never committed",
    98      "failPoint": {
    99        "configureFailPoint": "onPrimaryTransactionalWrite",
   100        "mode": {
   101          "times": 2
   102        },
   103        "data": {
   104          "failBeforeCommitExceptionCode": 1
   105        }
   106      },
   107      "operation": {
   108        "name": "findOneAndDelete",
   109        "arguments": {
   110          "filter": {
   111            "x": {
   112              "$gte": 11
   113            }
   114          },
   115          "sort": {
   116            "x": 1
   117          }
   118        }
   119      },
   120      "outcome": {
   121        "error": true,
   122        "collection": {
   123          "data": [
   124            {
   125              "_id": 1,
   126              "x": 11
   127            },
   128            {
   129              "_id": 2,
   130              "x": 22
   131            }
   132          ]
   133        }
   134      }
   135    }
   136  ]
   137}

View as plain text