...

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

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

     1{
     2  "runOn": [
     3    {
     4      "minServerVersion": "4.1.10"
     5    }
     6  ],
     7  "database_name": "default",
     8  "collection_name": "default",
     9  "data": [
    10    {
    11      "_id": 1,
    12      "encrypted_string": {
    13        "$binary": {
    14          "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==",
    15          "subType": "06"
    16        }
    17      }
    18    },
    19    {
    20      "_id": 2,
    21      "encrypted_string": {
    22        "$binary": {
    23          "base64": "AQAAAAAAAAAAAAAAAAAAAAACDdw4KFz3ZLquhsbt7RmDjD0N67n0uSXx7IGnQNCLeIKvot6s/ouI21Eo84IOtb6lhwUNPlSEBNY0/hbszWAKJg==",
    24          "subType": "06"
    25        }
    26      }
    27    }
    28  ],
    29  "json_schema": {
    30    "properties": {
    31      "encrypted_w_altname": {
    32        "encrypt": {
    33          "keyId": "/altname",
    34          "bsonType": "string",
    35          "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random"
    36        }
    37      },
    38      "encrypted_string": {
    39        "encrypt": {
    40          "keyId": [
    41            {
    42              "$binary": {
    43                "base64": "AAAAAAAAAAAAAAAAAAAAAA==",
    44                "subType": "04"
    45              }
    46            }
    47          ],
    48          "bsonType": "string",
    49          "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic"
    50        }
    51      },
    52      "random": {
    53        "encrypt": {
    54          "keyId": [
    55            {
    56              "$binary": {
    57                "base64": "AAAAAAAAAAAAAAAAAAAAAA==",
    58                "subType": "04"
    59              }
    60            }
    61          ],
    62          "bsonType": "string",
    63          "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random"
    64        }
    65      },
    66      "encrypted_string_equivalent": {
    67        "encrypt": {
    68          "keyId": [
    69            {
    70              "$binary": {
    71                "base64": "AAAAAAAAAAAAAAAAAAAAAA==",
    72                "subType": "04"
    73              }
    74            }
    75          ],
    76          "bsonType": "string",
    77          "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic"
    78        }
    79      }
    80    },
    81    "bsonType": "object"
    82  },
    83  "key_vault_data": [
    84    {
    85      "status": 1,
    86      "_id": {
    87        "$binary": {
    88          "base64": "AAAAAAAAAAAAAAAAAAAAAA==",
    89          "subType": "04"
    90        }
    91      },
    92      "masterKey": {
    93        "provider": "aws",
    94        "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0",
    95        "region": "us-east-1"
    96      },
    97      "updateDate": {
    98        "$date": {
    99          "$numberLong": "1552949630483"
   100        }
   101      },
   102      "keyMaterial": {
   103        "$binary": {
   104          "base64": "AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gEqnsxXlR51T5EbEVezUqqKAAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDHa4jo6yp0Z18KgbUgIBEIB74sKxWtV8/YHje5lv5THTl0HIbhSwM6EqRlmBiFFatmEWaeMk4tO4xBX65eq670I5TWPSLMzpp8ncGHMmvHqRajNBnmFtbYxN3E3/WjxmdbOOe+OXpnGJPcGsftc7cB2shRfA4lICPnE26+oVNXT6p0Lo20nY5XC7jyCO",
   105          "subType": "00"
   106        }
   107      },
   108      "creationDate": {
   109        "$date": {
   110          "$numberLong": "1552949630483"
   111        }
   112      },
   113      "keyAltNames": [
   114        "altname",
   115        "another_altname"
   116      ]
   117    }
   118  ],
   119  "tests": [
   120    {
   121      "description": "deleteOne with deterministic encryption",
   122      "clientOptions": {
   123        "autoEncryptOpts": {
   124          "kmsProviders": {
   125            "aws": {}
   126          }
   127        }
   128      },
   129      "operations": [
   130        {
   131          "name": "deleteOne",
   132          "arguments": {
   133            "filter": {
   134              "encrypted_string": "string0"
   135            }
   136          },
   137          "result": {
   138            "deletedCount": 1
   139          }
   140        }
   141      ],
   142      "expectations": [
   143        {
   144          "command_started_event": {
   145            "command": {
   146              "listCollections": 1,
   147              "filter": {
   148                "name": "default"
   149              }
   150            },
   151            "command_name": "listCollections"
   152          }
   153        },
   154        {
   155          "command_started_event": {
   156            "command": {
   157              "find": "datakeys",
   158              "filter": {
   159                "$or": [
   160                  {
   161                    "_id": {
   162                      "$in": [
   163                        {
   164                          "$binary": {
   165                            "base64": "AAAAAAAAAAAAAAAAAAAAAA==",
   166                            "subType": "04"
   167                          }
   168                        }
   169                      ]
   170                    }
   171                  },
   172                  {
   173                    "keyAltNames": {
   174                      "$in": []
   175                    }
   176                  }
   177                ]
   178              },
   179              "$db": "keyvault",
   180              "readConcern": {
   181                "level": "majority"
   182              }
   183            },
   184            "command_name": "find"
   185          }
   186        },
   187        {
   188          "command_started_event": {
   189            "command": {
   190              "delete": "default",
   191              "deletes": [
   192                {
   193                  "q": {
   194                    "encrypted_string": {
   195                      "$eq": {
   196                        "$binary": {
   197                          "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==",
   198                          "subType": "06"
   199                        }
   200                      }
   201                    }
   202                  },
   203                  "limit": 1
   204                }
   205              ],
   206              "ordered": true
   207            },
   208            "command_name": "delete"
   209          }
   210        }
   211      ],
   212      "outcome": {
   213        "collection": {
   214          "data": [
   215            {
   216              "_id": 2,
   217              "encrypted_string": {
   218                "$binary": {
   219                  "base64": "AQAAAAAAAAAAAAAAAAAAAAACDdw4KFz3ZLquhsbt7RmDjD0N67n0uSXx7IGnQNCLeIKvot6s/ouI21Eo84IOtb6lhwUNPlSEBNY0/hbszWAKJg==",
   220                  "subType": "06"
   221                }
   222              }
   223            }
   224          ]
   225        }
   226      }
   227    },
   228    {
   229      "description": "deleteMany with deterministic encryption",
   230      "clientOptions": {
   231        "autoEncryptOpts": {
   232          "kmsProviders": {
   233            "aws": {}
   234          }
   235        }
   236      },
   237      "operations": [
   238        {
   239          "name": "deleteMany",
   240          "arguments": {
   241            "filter": {
   242              "encrypted_string": {
   243                "$in": [
   244                  "string0",
   245                  "string1"
   246                ]
   247              }
   248            }
   249          },
   250          "result": {
   251            "deletedCount": 2
   252          }
   253        }
   254      ],
   255      "expectations": [
   256        {
   257          "command_started_event": {
   258            "command": {
   259              "listCollections": 1,
   260              "filter": {
   261                "name": "default"
   262              }
   263            },
   264            "command_name": "listCollections"
   265          }
   266        },
   267        {
   268          "command_started_event": {
   269            "command": {
   270              "find": "datakeys",
   271              "filter": {
   272                "$or": [
   273                  {
   274                    "_id": {
   275                      "$in": [
   276                        {
   277                          "$binary": {
   278                            "base64": "AAAAAAAAAAAAAAAAAAAAAA==",
   279                            "subType": "04"
   280                          }
   281                        }
   282                      ]
   283                    }
   284                  },
   285                  {
   286                    "keyAltNames": {
   287                      "$in": []
   288                    }
   289                  }
   290                ]
   291              },
   292              "$db": "keyvault",
   293              "readConcern": {
   294                "level": "majority"
   295              }
   296            },
   297            "command_name": "find"
   298          }
   299        },
   300        {
   301          "command_started_event": {
   302            "command": {
   303              "delete": "default",
   304              "deletes": [
   305                {
   306                  "q": {
   307                    "encrypted_string": {
   308                      "$in": [
   309                        {
   310                          "$binary": {
   311                            "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==",
   312                            "subType": "06"
   313                          }
   314                        },
   315                        {
   316                          "$binary": {
   317                            "base64": "AQAAAAAAAAAAAAAAAAAAAAACDdw4KFz3ZLquhsbt7RmDjD0N67n0uSXx7IGnQNCLeIKvot6s/ouI21Eo84IOtb6lhwUNPlSEBNY0/hbszWAKJg==",
   318                            "subType": "06"
   319                          }
   320                        }
   321                      ]
   322                    }
   323                  },
   324                  "limit": 0
   325                }
   326              ],
   327              "ordered": true
   328            },
   329            "command_name": "delete"
   330          }
   331        }
   332      ],
   333      "outcome": {
   334        "collection": {
   335          "data": []
   336        }
   337      }
   338    }
   339  ]
   340}

View as plain text