...

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

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

     1{
     2  "description": "unacknowledged-updateOne-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": "UpdateOne_hint",
    25        "collectionOptions": {
    26          "writeConcern": {
    27            "w": 0
    28          }
    29        }
    30      }
    31    }
    32  ],
    33  "initialData": [
    34    {
    35      "collectionName": "UpdateOne_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 updateOne with hint string fails with client-side error",
    52      "operations": [
    53        {
    54          "object": "collection0",
    55          "name": "updateOne",
    56          "arguments": {
    57            "filter": {
    58              "_id": {
    59                "$gt": 1
    60              }
    61            },
    62            "update": {
    63              "$inc": {
    64                "x": 1
    65              }
    66            },
    67            "hint": "_id_"
    68          },
    69          "expectError": {
    70            "isError": true
    71          }
    72        }
    73      ],
    74      "expectEvents": [
    75        {
    76          "client": "client0",
    77          "events": []
    78        }
    79      ],
    80      "outcome": [
    81        {
    82          "collectionName": "UpdateOne_hint",
    83          "databaseName": "crud-v2",
    84          "documents": [
    85            {
    86              "_id": 1,
    87              "x": 11
    88            },
    89            {
    90              "_id": 2,
    91              "x": 22
    92            }
    93          ]
    94        }
    95      ]
    96    },
    97    {
    98      "description": "Unacknowledged updateOne with hint document fails with client-side error",
    99      "operations": [
   100        {
   101          "object": "collection0",
   102          "name": "updateOne",
   103          "arguments": {
   104            "filter": {
   105              "_id": {
   106                "$gt": 1
   107              }
   108            },
   109            "update": {
   110              "$inc": {
   111                "x": 1
   112              }
   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      ],
   129      "outcome": [
   130        {
   131          "collectionName": "UpdateOne_hint",
   132          "databaseName": "crud-v2",
   133          "documents": [
   134            {
   135              "_id": 1,
   136              "x": 11
   137            },
   138            {
   139              "_id": 2,
   140              "x": 22
   141            }
   142          ]
   143        }
   144      ]
   145    }
   146  ]
   147}

View as plain text