...

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

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

     1{
     2  "description": "updateMany-comment",
     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-tests"
    18      }
    19    },
    20    {
    21      "collection": {
    22        "id": "collection0",
    23        "database": "database0",
    24        "collectionName": "coll0"
    25      }
    26    }
    27  ],
    28  "initialData": [
    29    {
    30      "collectionName": "coll0",
    31      "databaseName": "crud-tests",
    32      "documents": [
    33        {
    34          "_id": 1,
    35          "x": 11
    36        }
    37      ]
    38    }
    39  ],
    40  "tests": [
    41    {
    42      "description": "UpdateMany with string comment",
    43      "runOnRequirements": [
    44        {
    45          "minServerVersion": "4.4"
    46        }
    47      ],
    48      "operations": [
    49        {
    50          "name": "updateMany",
    51          "object": "collection0",
    52          "arguments": {
    53            "filter": {
    54              "_id": 1
    55            },
    56            "update": {
    57              "$set": {
    58                "x": 22
    59              }
    60            },
    61            "comment": "comment"
    62          }
    63        }
    64      ],
    65      "expectEvents": [
    66        {
    67          "client": "client0",
    68          "events": [
    69            {
    70              "commandStartedEvent": {
    71                "command": {
    72                  "update": "coll0",
    73                  "updates": [
    74                    {
    75                      "q": {
    76                        "_id": 1
    77                      },
    78                      "u": {
    79                        "$set": {
    80                          "x": 22
    81                        }
    82                      },
    83                      "multi": true,
    84                      "upsert": {
    85                        "$$unsetOrMatches": false
    86                      }
    87                    }
    88                  ],
    89                  "comment": "comment"
    90                }
    91              }
    92            }
    93          ]
    94        }
    95      ],
    96      "outcome": [
    97        {
    98          "collectionName": "coll0",
    99          "databaseName": "crud-tests",
   100          "documents": [
   101            {
   102              "_id": 1,
   103              "x": 22
   104            }
   105          ]
   106        }
   107      ]
   108    },
   109    {
   110      "description": "UpdateMany with document comment",
   111      "runOnRequirements": [
   112        {
   113          "minServerVersion": "4.4"
   114        }
   115      ],
   116      "operations": [
   117        {
   118          "name": "updateMany",
   119          "object": "collection0",
   120          "arguments": {
   121            "filter": {
   122              "_id": 1
   123            },
   124            "update": {
   125              "$set": {
   126                "x": 22
   127              }
   128            },
   129            "comment": {
   130              "key": "value"
   131            }
   132          }
   133        }
   134      ],
   135      "expectEvents": [
   136        {
   137          "client": "client0",
   138          "events": [
   139            {
   140              "commandStartedEvent": {
   141                "command": {
   142                  "update": "coll0",
   143                  "updates": [
   144                    {
   145                      "q": {
   146                        "_id": 1
   147                      },
   148                      "u": {
   149                        "$set": {
   150                          "x": 22
   151                        }
   152                      },
   153                      "multi": true,
   154                      "upsert": {
   155                        "$$unsetOrMatches": false
   156                      }
   157                    }
   158                  ],
   159                  "comment": {
   160                    "key": "value"
   161                  }
   162                }
   163              }
   164            }
   165          ]
   166        }
   167      ],
   168      "outcome": [
   169        {
   170          "collectionName": "coll0",
   171          "databaseName": "crud-tests",
   172          "documents": [
   173            {
   174              "_id": 1,
   175              "x": 22
   176            }
   177          ]
   178        }
   179      ]
   180    },
   181    {
   182      "description": "UpdateMany with comment - pre 4.4",
   183      "runOnRequirements": [
   184        {
   185          "minServerVersion": "3.4.0",
   186          "maxServerVersion": "4.2.99"
   187        }
   188      ],
   189      "operations": [
   190        {
   191          "name": "updateMany",
   192          "object": "collection0",
   193          "arguments": {
   194            "filter": {
   195              "_id": 1
   196            },
   197            "update": {
   198              "$set": {
   199                "x": 22
   200              }
   201            },
   202            "comment": "comment"
   203          },
   204          "expectError": {
   205            "isClientError": false
   206          }
   207        }
   208      ],
   209      "expectEvents": [
   210        {
   211          "client": "client0",
   212          "events": [
   213            {
   214              "commandStartedEvent": {
   215                "command": {
   216                  "update": "coll0",
   217                  "updates": [
   218                    {
   219                      "q": {
   220                        "_id": 1
   221                      },
   222                      "u": {
   223                        "$set": {
   224                          "x": 22
   225                        }
   226                      },
   227                      "multi": true,
   228                      "upsert": {
   229                        "$$unsetOrMatches": false
   230                      }
   231                    }
   232                  ],
   233                  "comment": "comment"
   234                }
   235              }
   236            }
   237          ]
   238        }
   239      ],
   240      "outcome": [
   241        {
   242          "collectionName": "coll0",
   243          "databaseName": "crud-tests",
   244          "documents": [
   245            {
   246              "_id": 1,
   247              "x": 11
   248            }
   249          ]
   250        }
   251      ]
   252    }
   253  ]
   254}

View as plain text