...

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

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

     1{
     2  "description": "findOneAndDelete-hint",
     3  "schemaVersion": "1.0",
     4  "runOnRequirements": [
     5    {
     6      "minServerVersion": "4.3.4"
     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": "findOneAndDelete_hint"
    30      }
    31    }
    32  ],
    33  "initialData": [
    34    {
    35      "collectionName": "findOneAndDelete_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    }
    48  ],
    49  "tests": [
    50    {
    51      "description": "FindOneAndDelete with hint string",
    52      "operations": [
    53        {
    54          "object": "collection0",
    55          "name": "findOneAndDelete",
    56          "arguments": {
    57            "filter": {
    58              "_id": 1
    59            },
    60            "hint": "_id_"
    61          },
    62          "expectResult": {
    63            "_id": 1,
    64            "x": 11
    65          }
    66        }
    67      ],
    68      "expectEvents": [
    69        {
    70          "client": "client0",
    71          "events": [
    72            {
    73              "commandStartedEvent": {
    74                "command": {
    75                  "findAndModify": "findOneAndDelete_hint",
    76                  "query": {
    77                    "_id": 1
    78                  },
    79                  "hint": "_id_",
    80                  "remove": true
    81                }
    82              }
    83            }
    84          ]
    85        }
    86      ],
    87      "outcome": [
    88        {
    89          "collectionName": "findOneAndDelete_hint",
    90          "databaseName": "crud-v2",
    91          "documents": [
    92            {
    93              "_id": 2,
    94              "x": 22
    95            }
    96          ]
    97        }
    98      ]
    99    },
   100    {
   101      "description": "FindOneAndDelete with hint document",
   102      "operations": [
   103        {
   104          "object": "collection0",
   105          "name": "findOneAndDelete",
   106          "arguments": {
   107            "filter": {
   108              "_id": 1
   109            },
   110            "hint": {
   111              "_id": 1
   112            }
   113          },
   114          "expectResult": {
   115            "_id": 1,
   116            "x": 11
   117          }
   118        }
   119      ],
   120      "expectEvents": [
   121        {
   122          "client": "client0",
   123          "events": [
   124            {
   125              "commandStartedEvent": {
   126                "command": {
   127                  "findAndModify": "findOneAndDelete_hint",
   128                  "query": {
   129                    "_id": 1
   130                  },
   131                  "hint": {
   132                    "_id": 1
   133                  },
   134                  "remove": true
   135                }
   136              }
   137            }
   138          ]
   139        }
   140      ],
   141      "outcome": [
   142        {
   143          "collectionName": "findOneAndDelete_hint",
   144          "databaseName": "crud-v2",
   145          "documents": [
   146            {
   147              "_id": 2,
   148              "x": 22
   149            }
   150          ]
   151        }
   152      ]
   153    }
   154  ]
   155}

View as plain text