...

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

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

     1{
     2  "description": "deleteMany-hint",
     3  "schemaVersion": "1.0",
     4  "runOnRequirements": [
     5    {
     6      "minServerVersion": "4.3.4"
     7    }
     8  ],
     9  "createEntities": [
    10    {
    11      "client": {
    12        "id": "client0",
    13        "observeEvents": [
    14          "commandStartedEvent"
    15        ]
    16      }
    17    },
    18    {
    19      "database": {
    20        "id": "database0",
    21        "client": "client0",
    22        "databaseName": "crud-v2"
    23      }
    24    },
    25    {
    26      "collection": {
    27        "id": "collection0",
    28        "database": "database0",
    29        "collectionName": "DeleteMany_hint"
    30      }
    31    }
    32  ],
    33  "initialData": [
    34    {
    35      "collectionName": "DeleteMany_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": "DeleteMany with hint string",
    56      "operations": [
    57        {
    58          "object": "collection0",
    59          "name": "deleteMany",
    60          "arguments": {
    61            "filter": {
    62              "_id": {
    63                "$gt": 1
    64              }
    65            },
    66            "hint": "_id_"
    67          },
    68          "expectResult": {
    69            "deletedCount": 2
    70          }
    71        }
    72      ],
    73      "expectEvents": [
    74        {
    75          "client": "client0",
    76          "events": [
    77            {
    78              "commandStartedEvent": {
    79                "command": {
    80                  "delete": "DeleteMany_hint",
    81                  "deletes": [
    82                    {
    83                      "q": {
    84                        "_id": {
    85                          "$gt": 1
    86                        }
    87                      },
    88                      "hint": "_id_",
    89                      "limit": 0
    90                    }
    91                  ]
    92                }
    93              }
    94            }
    95          ]
    96        }
    97      ],
    98      "outcome": [
    99        {
   100          "collectionName": "DeleteMany_hint",
   101          "databaseName": "crud-v2",
   102          "documents": [
   103            {
   104              "_id": 1,
   105              "x": 11
   106            }
   107          ]
   108        }
   109      ]
   110    },
   111    {
   112      "description": "DeleteMany with hint document",
   113      "operations": [
   114        {
   115          "object": "collection0",
   116          "name": "deleteMany",
   117          "arguments": {
   118            "filter": {
   119              "_id": {
   120                "$gt": 1
   121              }
   122            },
   123            "hint": {
   124              "_id": 1
   125            }
   126          },
   127          "expectResult": {
   128            "deletedCount": 2
   129          }
   130        }
   131      ],
   132      "expectEvents": [
   133        {
   134          "client": "client0",
   135          "events": [
   136            {
   137              "commandStartedEvent": {
   138                "command": {
   139                  "delete": "DeleteMany_hint",
   140                  "deletes": [
   141                    {
   142                      "q": {
   143                        "_id": {
   144                          "$gt": 1
   145                        }
   146                      },
   147                      "hint": {
   148                        "_id": 1
   149                      },
   150                      "limit": 0
   151                    }
   152                  ]
   153                }
   154              }
   155            }
   156          ]
   157        }
   158      ],
   159      "outcome": [
   160        {
   161          "collectionName": "DeleteMany_hint",
   162          "databaseName": "crud-v2",
   163          "documents": [
   164            {
   165              "_id": 1,
   166              "x": 11
   167            }
   168          ]
   169        }
   170      ]
   171    }
   172  ]
   173}

View as plain text