...

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

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

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

View as plain text