...

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

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

     1{
     2  "description": "findOneAndDelete-hint-serverError",
     3  "schemaVersion": "1.0",
     4  "runOnRequirements": [
     5    {
     6      "minServerVersion": "4.2.0",
     7      "maxServerVersion": "4.3.3"
     8    }
     9  ],
    10  "createEntities": [
    11    {
    12      "client": {
    13        "id": "client0",
    14        "observeEvents": [
    15          "commandStartedEvent"
    16        ]
    17      }
    18    },
    19    {
    20      "database": {
    21        "id": "database0",
    22        "client": "client0",
    23        "databaseName": "crud-v2"
    24      }
    25    },
    26    {
    27      "collection": {
    28        "id": "collection0",
    29        "database": "database0",
    30        "collectionName": "findOneAndDelete_hint"
    31      }
    32    }
    33  ],
    34  "initialData": [
    35    {
    36      "collectionName": "findOneAndDelete_hint",
    37      "databaseName": "crud-v2",
    38      "documents": [
    39        {
    40          "_id": 1,
    41          "x": 11
    42        },
    43        {
    44          "_id": 2,
    45          "x": 22
    46        }
    47      ]
    48    }
    49  ],
    50  "tests": [
    51    {
    52      "description": "FindOneAndDelete with hint string unsupported (server-side error)",
    53      "operations": [
    54        {
    55          "object": "collection0",
    56          "name": "findOneAndDelete",
    57          "arguments": {
    58            "filter": {
    59              "_id": 1
    60            },
    61            "hint": "_id_"
    62          },
    63          "expectError": {
    64            "isError": true
    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": 1,
    94              "x": 11
    95            },
    96            {
    97              "_id": 2,
    98              "x": 22
    99            }
   100          ]
   101        }
   102      ]
   103    },
   104    {
   105      "description": "FindOneAndDelete with hint document unsupported (server-side error)",
   106      "operations": [
   107        {
   108          "object": "collection0",
   109          "name": "findOneAndDelete",
   110          "arguments": {
   111            "filter": {
   112              "_id": 1
   113            },
   114            "hint": {
   115              "_id": 1
   116            }
   117          },
   118          "expectError": {
   119            "isError": true
   120          }
   121        }
   122      ],
   123      "expectEvents": [
   124        {
   125          "client": "client0",
   126          "events": [
   127            {
   128              "commandStartedEvent": {
   129                "command": {
   130                  "findAndModify": "findOneAndDelete_hint",
   131                  "query": {
   132                    "_id": 1
   133                  },
   134                  "hint": {
   135                    "_id": 1
   136                  },
   137                  "remove": true
   138                }
   139              }
   140            }
   141          ]
   142        }
   143      ],
   144      "outcome": [
   145        {
   146          "collectionName": "findOneAndDelete_hint",
   147          "databaseName": "crud-v2",
   148          "documents": [
   149            {
   150              "_id": 1,
   151              "x": 11
   152            },
   153            {
   154              "_id": 2,
   155              "x": 22
   156            }
   157          ]
   158        }
   159      ]
   160    }
   161  ]
   162}

View as plain text