...

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

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

     1{
     2  "description": "findOneAndUpdate-hint-serverError",
     3  "schemaVersion": "1.0",
     4  "runOnRequirements": [
     5    {
     6      "minServerVersion": "4.2.0",
     7      "maxServerVersion": "4.3.0"
     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": "findOneAndUpdate_hint"
    31      }
    32    }
    33  ],
    34  "initialData": [
    35    {
    36      "collectionName": "findOneAndUpdate_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": "FindOneAndUpdate with hint string unsupported (server-side error)",
    53      "operations": [
    54        {
    55          "object": "collection0",
    56          "name": "findOneAndUpdate",
    57          "arguments": {
    58            "filter": {
    59              "_id": 1
    60            },
    61            "update": {
    62              "$inc": {
    63                "x": 1
    64              }
    65            },
    66            "hint": "_id_"
    67          },
    68          "expectError": {
    69            "isError": true
    70          }
    71        }
    72      ],
    73      "expectEvents": [
    74        {
    75          "client": "client0",
    76          "events": [
    77            {
    78              "commandStartedEvent": {
    79                "command": {
    80                  "findAndModify": "findOneAndUpdate_hint",
    81                  "query": {
    82                    "_id": 1
    83                  },
    84                  "update": {
    85                    "$inc": {
    86                      "x": 1
    87                    }
    88                  },
    89                  "hint": "_id_"
    90                }
    91              }
    92            }
    93          ]
    94        }
    95      ],
    96      "outcome": [
    97        {
    98          "collectionName": "findOneAndUpdate_hint",
    99          "databaseName": "crud-v2",
   100          "documents": [
   101            {
   102              "_id": 1,
   103              "x": 11
   104            },
   105            {
   106              "_id": 2,
   107              "x": 22
   108            }
   109          ]
   110        }
   111      ]
   112    },
   113    {
   114      "description": "FindOneAndUpdate with hint document unsupported (server-side error)",
   115      "operations": [
   116        {
   117          "object": "collection0",
   118          "name": "findOneAndUpdate",
   119          "arguments": {
   120            "filter": {
   121              "_id": 1
   122            },
   123            "update": {
   124              "$inc": {
   125                "x": 1
   126              }
   127            },
   128            "hint": {
   129              "_id": 1
   130            }
   131          },
   132          "expectError": {
   133            "isError": true
   134          }
   135        }
   136      ],
   137      "expectEvents": [
   138        {
   139          "client": "client0",
   140          "events": [
   141            {
   142              "commandStartedEvent": {
   143                "command": {
   144                  "findAndModify": "findOneAndUpdate_hint",
   145                  "query": {
   146                    "_id": 1
   147                  },
   148                  "update": {
   149                    "$inc": {
   150                      "x": 1
   151                    }
   152                  },
   153                  "hint": {
   154                    "_id": 1
   155                  }
   156                }
   157              }
   158            }
   159          ]
   160        }
   161      ],
   162      "outcome": [
   163        {
   164          "collectionName": "findOneAndUpdate_hint",
   165          "databaseName": "crud-v2",
   166          "documents": [
   167            {
   168              "_id": 1,
   169              "x": 11
   170            },
   171            {
   172              "_id": 2,
   173              "x": 22
   174            }
   175          ]
   176        }
   177      ]
   178    }
   179  ]
   180}

View as plain text