...

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

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

     1{
     2  "description": "BulkWrite deleteOne-let",
     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        }
    39      ]
    40    }
    41  ],
    42  "tests": [
    43    {
    44      "description": "BulkWrite deleteOne with let option",
    45      "runOnRequirements": [
    46        {
    47          "minServerVersion": "5.0"
    48        }
    49      ],
    50      "operations": [
    51        {
    52          "object": "collection0",
    53          "name": "bulkWrite",
    54          "arguments": {
    55            "requests": [
    56              {
    57                "deleteOne": {
    58                  "filter": {
    59                    "$expr": {
    60                      "$eq": [
    61                        "$_id",
    62                        "$$id"
    63                      ]
    64                    }
    65                  }
    66                }
    67              }
    68            ],
    69            "let": {
    70              "id": 1
    71            }
    72          }
    73        }
    74      ],
    75      "expectEvents": [
    76        {
    77          "client": "client0",
    78          "events": [
    79            {
    80              "commandStartedEvent": {
    81                "command": {
    82                  "delete": "coll0",
    83                  "deletes": [
    84                    {
    85                      "q": {
    86                        "$expr": {
    87                          "$eq": [
    88                            "$_id",
    89                            "$$id"
    90                          ]
    91                        }
    92                      },
    93                      "limit": 1
    94                    }
    95                  ],
    96                  "let": {
    97                    "id": 1
    98                  }
    99                }
   100              }
   101            }
   102          ]
   103        }
   104      ],
   105      "outcome": [
   106        {
   107          "collectionName": "coll0",
   108          "databaseName": "crud-tests",
   109          "documents": [
   110            {
   111              "_id": 2
   112            }
   113          ]
   114        }
   115      ]
   116    },
   117    {
   118      "description": "BulkWrite deleteOne with let option unsupported (server-side error)",
   119      "runOnRequirements": [
   120        {
   121          "minServerVersion": "3.6.0",
   122          "maxServerVersion": "4.9"
   123        }
   124      ],
   125      "operations": [
   126        {
   127          "object": "collection0",
   128          "name": "bulkWrite",
   129          "arguments": {
   130            "requests": [
   131              {
   132                "deleteOne": {
   133                  "filter": {
   134                    "$expr": {
   135                      "$eq": [
   136                        "$_id",
   137                        "$$id"
   138                      ]
   139                    }
   140                  }
   141                }
   142              }
   143            ],
   144            "let": {
   145              "id": 1
   146            }
   147          },
   148          "expectError": {
   149            "errorContains": "'delete.let' is an unknown field",
   150            "isClientError": false
   151          }
   152        }
   153      ],
   154      "expectEvents": [
   155        {
   156          "client": "client0",
   157          "events": [
   158            {
   159              "commandStartedEvent": {
   160                "command": {
   161                  "delete": "coll0",
   162                  "deletes": [
   163                    {
   164                      "q": {
   165                        "$expr": {
   166                          "$eq": [
   167                            "$_id",
   168                            "$$id"
   169                          ]
   170                        }
   171                      },
   172                      "limit": 1
   173                    }
   174                  ],
   175                  "let": {
   176                    "id": 1
   177                  }
   178                }
   179              }
   180            }
   181          ]
   182        }
   183      ],
   184      "outcome": [
   185        {
   186          "collectionName": "coll0",
   187          "databaseName": "crud-tests",
   188          "documents": [
   189            {
   190              "_id": 1
   191            },
   192            {
   193              "_id": 2
   194            }
   195          ]
   196        }
   197      ]
   198    }
   199  ]
   200}

View as plain text