...

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

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

     1{
     2  "description": "unacknowledged-updateMany-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": "Updatemany_hint",
    25        "collectionOptions": {
    26          "writeConcern": {
    27            "w": 0
    28          }
    29        }
    30      }
    31    }
    32  ],
    33  "initialData": [
    34    {
    35      "collectionName": "Updatemany_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          "_id": 3,
    48          "x": 33
    49        }
    50      ]
    51    }
    52  ],
    53  "tests": [
    54    {
    55      "description": "Unacknowledged updateMany with hint string fails with client-side error",
    56      "operations": [
    57        {
    58          "object": "collection0",
    59          "name": "updateMany",
    60          "arguments": {
    61            "filter": {
    62              "_id": {
    63                "$gt": 1
    64              }
    65            },
    66            "update": {
    67              "$inc": {
    68                "x": 1
    69              }
    70            },
    71            "hint": "_id_"
    72          },
    73          "expectError": {
    74            "isError": true
    75          }
    76        }
    77      ],
    78      "expectEvents": [
    79        {
    80          "client": "client0",
    81          "events": []
    82        }
    83      ],
    84      "outcome": [
    85        {
    86          "collectionName": "Updatemany_hint",
    87          "databaseName": "crud-v2",
    88          "documents": [
    89            {
    90              "_id": 1,
    91              "x": 11
    92            },
    93            {
    94              "_id": 2,
    95              "x": 22
    96            },
    97            {
    98              "_id": 3,
    99              "x": 33
   100            }
   101          ]
   102        }
   103      ]
   104    },
   105    {
   106      "description": "Unacknowledged updateMany with hint document fails with client-side error",
   107      "operations": [
   108        {
   109          "object": "collection0",
   110          "name": "updateMany",
   111          "arguments": {
   112            "filter": {
   113              "_id": {
   114                "$gt": 1
   115              }
   116            },
   117            "update": {
   118              "$inc": {
   119                "x": 1
   120              }
   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      ],
   137      "outcome": [
   138        {
   139          "collectionName": "Updatemany_hint",
   140          "databaseName": "crud-v2",
   141          "documents": [
   142            {
   143              "_id": 1,
   144              "x": 11
   145            },
   146            {
   147              "_id": 2,
   148              "x": 22
   149            },
   150            {
   151              "_id": 3,
   152              "x": 33
   153            }
   154          ]
   155        }
   156      ]
   157    }
   158  ]
   159}

View as plain text