...

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

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

     1{
     2  "description": "deleteOne-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": "DeleteOne_hint"
    30      }
    31    }
    32  ],
    33  "initialData": [
    34    {
    35      "collectionName": "DeleteOne_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    }
    48  ],
    49  "tests": [
    50    {
    51      "description": "DeleteOne with hint string",
    52      "operations": [
    53        {
    54          "object": "collection0",
    55          "name": "deleteOne",
    56          "arguments": {
    57            "filter": {
    58              "_id": 1
    59            },
    60            "hint": "_id_"
    61          },
    62          "expectResult": {
    63            "deletedCount": 1
    64          }
    65        }
    66      ],
    67      "expectEvents": [
    68        {
    69          "client": "client0",
    70          "events": [
    71            {
    72              "commandStartedEvent": {
    73                "command": {
    74                  "delete": "DeleteOne_hint",
    75                  "deletes": [
    76                    {
    77                      "q": {
    78                        "_id": 1
    79                      },
    80                      "hint": "_id_",
    81                      "limit": 1
    82                    }
    83                  ]
    84                }
    85              }
    86            }
    87          ]
    88        }
    89      ],
    90      "outcome": [
    91        {
    92          "collectionName": "DeleteOne_hint",
    93          "databaseName": "crud-v2",
    94          "documents": [
    95            {
    96              "_id": 2,
    97              "x": 22
    98            }
    99          ]
   100        }
   101      ]
   102    },
   103    {
   104      "description": "deleteOne with hint document",
   105      "operations": [
   106        {
   107          "object": "collection0",
   108          "name": "deleteOne",
   109          "arguments": {
   110            "filter": {
   111              "_id": 1
   112            },
   113            "hint": {
   114              "_id": 1
   115            }
   116          },
   117          "expectResult": {
   118            "deletedCount": 1
   119          }
   120        }
   121      ],
   122      "expectEvents": [
   123        {
   124          "client": "client0",
   125          "events": [
   126            {
   127              "commandStartedEvent": {
   128                "command": {
   129                  "delete": "DeleteOne_hint",
   130                  "deletes": [
   131                    {
   132                      "q": {
   133                        "_id": 1
   134                      },
   135                      "hint": {
   136                        "_id": 1
   137                      },
   138                      "limit": 1
   139                    }
   140                  ]
   141                }
   142              }
   143            }
   144          ]
   145        }
   146      ],
   147      "outcome": [
   148        {
   149          "collectionName": "DeleteOne_hint",
   150          "databaseName": "crud-v2",
   151          "documents": [
   152            {
   153              "_id": 2,
   154              "x": 22
   155            }
   156          ]
   157        }
   158      ]
   159    }
   160  ]
   161}

View as plain text