...

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

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

     1{
     2  "description": "unacknowledged-findOneAndReplace-hint-clientError",
     3  "schemaVersion": "1.0",
     4  "createEntities": [
     5    {
     6      "client": {
     7        "id": "client0",
     8        "observeEvents": [
     9          "commandStartedEvent"
    10        ]
    11      }
    12    },
    13    {
    14      "database": {
    15        "id": "database0",
    16        "client": "client0",
    17        "databaseName": "crud-v2"
    18      }
    19    },
    20    {
    21      "collection": {
    22        "id": "collection0",
    23        "database": "database0",
    24        "collectionName": "FindOneAndReplace_hint",
    25        "collectionOptions": {
    26          "writeConcern": {
    27            "w": 0
    28          }
    29        }
    30      }
    31    }
    32  ],
    33  "initialData": [
    34    {
    35      "collectionName": "FindOneAndReplace_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": "Unacknowledged findOneAndReplace with hint string fails with client-side error",
    52      "operations": [
    53        {
    54          "object": "collection0",
    55          "name": "findOneAndReplace",
    56          "arguments": {
    57            "filter": {
    58              "_id": 1
    59            },
    60            "replacement": {
    61              "x": 33
    62            },
    63            "hint": "_id_"
    64          },
    65          "expectError": {
    66            "isError": true
    67          }
    68        }
    69      ],
    70      "expectEvents": [
    71        {
    72          "client": "client0",
    73          "events": []
    74        }
    75      ],
    76      "outcome": [
    77        {
    78          "collectionName": "FindOneAndReplace_hint",
    79          "databaseName": "crud-v2",
    80          "documents": [
    81            {
    82              "_id": 1,
    83              "x": 11
    84            },
    85            {
    86              "_id": 2,
    87              "x": 22
    88            }
    89          ]
    90        }
    91      ]
    92    },
    93    {
    94      "description": "Unacknowledged findOneAndReplace with hint document fails with client-side error",
    95      "operations": [
    96        {
    97          "object": "collection0",
    98          "name": "findOneAndReplace",
    99          "arguments": {
   100            "filter": {
   101              "_id": 1
   102            },
   103            "replacement": {
   104              "x": 33
   105            },
   106            "hint": {
   107              "_id": 1
   108            }
   109          },
   110          "expectError": {
   111            "isError": true
   112          }
   113        }
   114      ],
   115      "expectEvents": [
   116        {
   117          "client": "client0",
   118          "events": []
   119        }
   120      ],
   121      "outcome": [
   122        {
   123          "collectionName": "FindOneAndReplace_hint",
   124          "databaseName": "crud-v2",
   125          "documents": [
   126            {
   127              "_id": 1,
   128              "x": 11
   129            },
   130            {
   131              "_id": 2,
   132              "x": 22
   133            }
   134          ]
   135        }
   136      ]
   137    }
   138  ]
   139}

View as plain text