...

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

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

     1{
     2  "description": "deleteOne-hint-serverError",
     3  "schemaVersion": "1.0",
     4  "runOnRequirements": [
     5    {
     6      "minServerVersion": "3.4.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": "DeleteOne_hint"
    31      }
    32    }
    33  ],
    34  "initialData": [
    35    {
    36      "collectionName": "DeleteOne_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": "DeleteOne with hint string unsupported (server-side error)",
    53      "operations": [
    54        {
    55          "object": "collection0",
    56          "name": "deleteOne",
    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                  "delete": "DeleteOne_hint",
    76                  "deletes": [
    77                    {
    78                      "q": {
    79                        "_id": 1
    80                      },
    81                      "hint": "_id_",
    82                      "limit": 1
    83                    }
    84                  ]
    85                }
    86              }
    87            }
    88          ]
    89        }
    90      ],
    91      "outcome": [
    92        {
    93          "collectionName": "DeleteOne_hint",
    94          "databaseName": "crud-v2",
    95          "documents": [
    96            {
    97              "_id": 1,
    98              "x": 11
    99            },
   100            {
   101              "_id": 2,
   102              "x": 22
   103            }
   104          ]
   105        }
   106      ]
   107    },
   108    {
   109      "description": "DeleteOne with hint document unsupported (server-side error)",
   110      "operations": [
   111        {
   112          "object": "collection0",
   113          "name": "deleteOne",
   114          "arguments": {
   115            "filter": {
   116              "_id": 1
   117            },
   118            "hint": {
   119              "_id": 1
   120            }
   121          },
   122          "expectError": {
   123            "isError": true
   124          }
   125        }
   126      ],
   127      "expectEvents": [
   128        {
   129          "client": "client0",
   130          "events": [
   131            {
   132              "commandStartedEvent": {
   133                "command": {
   134                  "delete": "DeleteOne_hint",
   135                  "deletes": [
   136                    {
   137                      "q": {
   138                        "_id": 1
   139                      },
   140                      "hint": {
   141                        "_id": 1
   142                      },
   143                      "limit": 1
   144                    }
   145                  ]
   146                }
   147              }
   148            }
   149          ]
   150        }
   151      ],
   152      "outcome": [
   153        {
   154          "collectionName": "DeleteOne_hint",
   155          "databaseName": "crud-v2",
   156          "documents": [
   157            {
   158              "_id": 1,
   159              "x": 11
   160            },
   161            {
   162              "_id": 2,
   163              "x": 22
   164            }
   165          ]
   166        }
   167      ]
   168    }
   169  ]
   170}

View as plain text