...

Text file src/go.mongodb.org/mongo-driver/testdata/client-side-encryption/legacy/fle2v2-Delete.json

Documentation: go.mongodb.org/mongo-driver/testdata/client-side-encryption/legacy

     1{
     2  "runOn": [
     3    {
     4      "minServerVersion": "7.0.0",
     5      "topology": [
     6        "replicaset",
     7        "sharded",
     8        "load-balanced"
     9      ]
    10    }
    11  ],
    12  "database_name": "default",
    13  "collection_name": "default",
    14  "data": [],
    15  "encrypted_fields": {
    16    "fields": [
    17      {
    18        "keyId": {
    19          "$binary": {
    20            "base64": "EjRWeBI0mHYSNBI0VniQEg==",
    21            "subType": "04"
    22          }
    23        },
    24        "path": "encryptedIndexed",
    25        "bsonType": "string",
    26        "queries": {
    27          "queryType": "equality",
    28          "contention": {
    29            "$numberLong": "0"
    30          }
    31        }
    32      },
    33      {
    34        "keyId": {
    35          "$binary": {
    36            "base64": "q83vqxI0mHYSNBI0VniQEg==",
    37            "subType": "04"
    38          }
    39        },
    40        "path": "encryptedUnindexed",
    41        "bsonType": "string"
    42      }
    43    ]
    44  },
    45  "key_vault_data": [
    46    {
    47      "_id": {
    48        "$binary": {
    49          "base64": "EjRWeBI0mHYSNBI0VniQEg==",
    50          "subType": "04"
    51        }
    52      },
    53      "keyMaterial": {
    54        "$binary": {
    55          "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==",
    56          "subType": "00"
    57        }
    58      },
    59      "creationDate": {
    60        "$date": {
    61          "$numberLong": "1648914851981"
    62        }
    63      },
    64      "updateDate": {
    65        "$date": {
    66          "$numberLong": "1648914851981"
    67        }
    68      },
    69      "status": {
    70        "$numberInt": "0"
    71      },
    72      "masterKey": {
    73        "provider": "local"
    74      }
    75    }
    76  ],
    77  "tests": [
    78    {
    79      "description": "Delete can query an FLE2 indexed field",
    80      "clientOptions": {
    81        "autoEncryptOpts": {
    82          "kmsProviders": {
    83            "local": {
    84              "key": {
    85                "$binary": {
    86                  "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk",
    87                  "subType": "00"
    88                }
    89              }
    90            }
    91          }
    92        }
    93      },
    94      "operations": [
    95        {
    96          "name": "insertOne",
    97          "arguments": {
    98            "document": {
    99              "_id": 1,
   100              "encryptedIndexed": "value123"
   101            }
   102          }
   103        },
   104        {
   105          "name": "deleteOne",
   106          "arguments": {
   107            "filter": {
   108              "encryptedIndexed": "value123"
   109            }
   110          },
   111          "result": {
   112            "deletedCount": 1
   113          }
   114        }
   115      ],
   116      "expectations": [
   117        {
   118          "command_started_event": {
   119            "command": {
   120              "listCollections": 1,
   121              "filter": {
   122                "name": "default"
   123              }
   124            },
   125            "command_name": "listCollections"
   126          }
   127        },
   128        {
   129          "command_started_event": {
   130            "command": {
   131              "find": "datakeys",
   132              "filter": {
   133                "$or": [
   134                  {
   135                    "_id": {
   136                      "$in": [
   137                        {
   138                          "$binary": {
   139                            "base64": "EjRWeBI0mHYSNBI0VniQEg==",
   140                            "subType": "04"
   141                          }
   142                        }
   143                      ]
   144                    }
   145                  },
   146                  {
   147                    "keyAltNames": {
   148                      "$in": []
   149                    }
   150                  }
   151                ]
   152              },
   153              "$db": "keyvault",
   154              "readConcern": {
   155                "level": "majority"
   156              }
   157            },
   158            "command_name": "find"
   159          }
   160        },
   161        {
   162          "command_started_event": {
   163            "command": {
   164              "insert": "default",
   165              "documents": [
   166                {
   167                  "_id": 1,
   168                  "encryptedIndexed": {
   169                    "$$type": "binData"
   170                  }
   171                }
   172              ],
   173              "ordered": true,
   174              "encryptionInformation": {
   175                "type": 1,
   176                "schema": {
   177                  "default.default": {
   178                    "escCollection": "enxcol_.default.esc",
   179                    "ecocCollection": "enxcol_.default.ecoc",
   180                    "fields": [
   181                      {
   182                        "keyId": {
   183                          "$binary": {
   184                            "base64": "EjRWeBI0mHYSNBI0VniQEg==",
   185                            "subType": "04"
   186                          }
   187                        },
   188                        "path": "encryptedIndexed",
   189                        "bsonType": "string",
   190                        "queries": {
   191                          "queryType": "equality",
   192                          "contention": {
   193                            "$numberLong": "0"
   194                          }
   195                        }
   196                      },
   197                      {
   198                        "keyId": {
   199                          "$binary": {
   200                            "base64": "q83vqxI0mHYSNBI0VniQEg==",
   201                            "subType": "04"
   202                          }
   203                        },
   204                        "path": "encryptedUnindexed",
   205                        "bsonType": "string"
   206                      }
   207                    ]
   208                  }
   209                }
   210              }
   211            },
   212            "command_name": "insert"
   213          }
   214        },
   215        {
   216          "command_started_event": {
   217            "command": {
   218              "delete": "default",
   219              "deletes": [
   220                {
   221                  "q": {
   222                    "encryptedIndexed": {
   223                      "$eq": {
   224                        "$binary": {
   225                          "base64": "DIkAAAAFZAAgAAAAAPtVteJQAlgb2YMa/+7YWH00sbQPyt7L6Rb8OwBdMmL2BXMAIAAAAAAd44hgVKnEnTFlwNVC14oyc9OZOTspeymusqkRQj57nAVsACAAAAAAaZ9s3G+4znfxStxeOZwcZy1OhzjMGc5hjmdMN+b/w6kSY20AAAAAAAAAAAAA",
   226                          "subType": "06"
   227                        }
   228                      }
   229                    }
   230                  },
   231                  "limit": 1
   232                }
   233              ],
   234              "ordered": true,
   235              "encryptionInformation": {
   236                "type": 1,
   237                "schema": {
   238                  "default.default": {
   239                    "escCollection": "enxcol_.default.esc",
   240                    "ecocCollection": "enxcol_.default.ecoc",
   241                    "fields": [
   242                      {
   243                        "keyId": {
   244                          "$binary": {
   245                            "base64": "EjRWeBI0mHYSNBI0VniQEg==",
   246                            "subType": "04"
   247                          }
   248                        },
   249                        "path": "encryptedIndexed",
   250                        "bsonType": "string",
   251                        "queries": {
   252                          "queryType": "equality",
   253                          "contention": {
   254                            "$numberLong": "0"
   255                          }
   256                        }
   257                      },
   258                      {
   259                        "keyId": {
   260                          "$binary": {
   261                            "base64": "q83vqxI0mHYSNBI0VniQEg==",
   262                            "subType": "04"
   263                          }
   264                        },
   265                        "path": "encryptedUnindexed",
   266                        "bsonType": "string"
   267                      }
   268                    ]
   269                  }
   270                }
   271              }
   272            },
   273            "command_name": "delete"
   274          }
   275        }
   276      ],
   277      "outcome": {
   278        "collection": {
   279          "data": []
   280        }
   281      }
   282    }
   283  ]
   284}

View as plain text