...

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

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

     1{
     2  "description": "updateOne-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": "UpdateOne with string comment",
    43      "runOnRequirements": [
    44        {
    45          "minServerVersion": "4.4"
    46        }
    47      ],
    48      "operations": [
    49        {
    50          "name": "updateOne",
    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": {
    84                        "$$unsetOrMatches": false
    85                      },
    86                      "upsert": {
    87                        "$$unsetOrMatches": false
    88                      }
    89                    }
    90                  ],
    91                  "comment": "comment"
    92                }
    93              }
    94            }
    95          ]
    96        }
    97      ],
    98      "outcome": [
    99        {
   100          "collectionName": "coll0",
   101          "databaseName": "crud-tests",
   102          "documents": [
   103            {
   104              "_id": 1,
   105              "x": 22
   106            }
   107          ]
   108        }
   109      ]
   110    },
   111    {
   112      "description": "UpdateOne with document comment",
   113      "runOnRequirements": [
   114        {
   115          "minServerVersion": "4.4"
   116        }
   117      ],
   118      "operations": [
   119        {
   120          "name": "updateOne",
   121          "object": "collection0",
   122          "arguments": {
   123            "filter": {
   124              "_id": 1
   125            },
   126            "update": {
   127              "$set": {
   128                "x": 22
   129              }
   130            },
   131            "comment": {
   132              "key": "value"
   133            }
   134          }
   135        }
   136      ],
   137      "expectEvents": [
   138        {
   139          "client": "client0",
   140          "events": [
   141            {
   142              "commandStartedEvent": {
   143                "command": {
   144                  "update": "coll0",
   145                  "updates": [
   146                    {
   147                      "q": {
   148                        "_id": 1
   149                      },
   150                      "u": {
   151                        "$set": {
   152                          "x": 22
   153                        }
   154                      },
   155                      "multi": {
   156                        "$$unsetOrMatches": false
   157                      },
   158                      "upsert": {
   159                        "$$unsetOrMatches": false
   160                      }
   161                    }
   162                  ],
   163                  "comment": {
   164                    "key": "value"
   165                  }
   166                }
   167              }
   168            }
   169          ]
   170        }
   171      ],
   172      "outcome": [
   173        {
   174          "collectionName": "coll0",
   175          "databaseName": "crud-tests",
   176          "documents": [
   177            {
   178              "_id": 1,
   179              "x": 22
   180            }
   181          ]
   182        }
   183      ]
   184    },
   185    {
   186      "description": "UpdateOne with comment - pre 4.4",
   187      "runOnRequirements": [
   188        {
   189          "minServerVersion": "3.4.0",
   190          "maxServerVersion": "4.2.99"
   191        }
   192      ],
   193      "operations": [
   194        {
   195          "name": "updateOne",
   196          "object": "collection0",
   197          "arguments": {
   198            "filter": {
   199              "_id": 1
   200            },
   201            "update": {
   202              "$set": {
   203                "x": 22
   204              }
   205            },
   206            "comment": "comment"
   207          },
   208          "expectError": {
   209            "isClientError": false
   210          }
   211        }
   212      ],
   213      "expectEvents": [
   214        {
   215          "client": "client0",
   216          "events": [
   217            {
   218              "commandStartedEvent": {
   219                "command": {
   220                  "update": "coll0",
   221                  "updates": [
   222                    {
   223                      "q": {
   224                        "_id": 1
   225                      },
   226                      "u": {
   227                        "$set": {
   228                          "x": 22
   229                        }
   230                      },
   231                      "multi": {
   232                        "$$unsetOrMatches": false
   233                      },
   234                      "upsert": {
   235                        "$$unsetOrMatches": false
   236                      }
   237                    }
   238                  ],
   239                  "comment": "comment"
   240                }
   241              }
   242            }
   243          ]
   244        }
   245      ],
   246      "outcome": [
   247        {
   248          "collectionName": "coll0",
   249          "databaseName": "crud-tests",
   250          "documents": [
   251            {
   252              "_id": 1,
   253              "x": 11
   254            }
   255          ]
   256        }
   257      ]
   258    }
   259  ]
   260}

View as plain text