...

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

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

     1{
     2  "data": [
     3    {
     4      "_id": 1,
     5      "x": 11
     6    },
     7    {
     8      "_id": 2,
     9      "x": 22
    10    },
    11    {
    12      "_id": 3,
    13      "x": 33
    14    }
    15  ],
    16  "tests": [
    17    {
    18      "description": "DeleteOne when many documents match",
    19      "operation": {
    20        "name": "deleteOne",
    21        "arguments": {
    22          "filter": {
    23            "_id": {
    24              "$gt": 1
    25            }
    26          }
    27        }
    28      },
    29      "outcome": {
    30        "result": {
    31          "deletedCount": 1
    32        }
    33      }
    34    },
    35    {
    36      "description": "DeleteOne when one document matches",
    37      "operation": {
    38        "name": "deleteOne",
    39        "arguments": {
    40          "filter": {
    41            "_id": 2
    42          }
    43        }
    44      },
    45      "outcome": {
    46        "result": {
    47          "deletedCount": 1
    48        },
    49        "collection": {
    50          "data": [
    51            {
    52              "_id": 1,
    53              "x": 11
    54            },
    55            {
    56              "_id": 3,
    57              "x": 33
    58            }
    59          ]
    60        }
    61      }
    62    },
    63    {
    64      "description": "DeleteOne when no documents match",
    65      "operation": {
    66        "name": "deleteOne",
    67        "arguments": {
    68          "filter": {
    69            "_id": 4
    70          }
    71        }
    72      },
    73      "outcome": {
    74        "result": {
    75          "deletedCount": 0
    76        },
    77        "collection": {
    78          "data": [
    79            {
    80              "_id": 1,
    81              "x": 11
    82            },
    83            {
    84              "_id": 2,
    85              "x": 22
    86            },
    87            {
    88              "_id": 3,
    89              "x": 33
    90            }
    91          ]
    92        }
    93      }
    94    }
    95  ]
    96}

View as plain text