...

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

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

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

View as plain text