# Requires libmongocrypt 1.8.0. runOn: - minServerVersion: "7.0.0" # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] database_name: &database_name "default" collection_name: &collection_name "default" data: [] encrypted_fields: &encrypted_fields {'fields': [{'keyId': {'$binary': {'base64': 'EjRWeBI0mHYSNBI0VniQEg==', 'subType': '04'}}, 'path': 'encryptedLong', 'bsonType': 'long', 'queries': {'queryType': 'rangePreview', 'contention': {'$numberLong': '0'}, 'sparsity': {'$numberLong': '1'}, 'min': {'$numberLong': '0'}, 'max': {'$numberLong': '200'}}}]} key_vault_data: [ {'_id': {'$binary': {'base64': 'EjRWeBI0mHYSNBI0VniQEg==', 'subType': '04'}}, 'keyMaterial': {'$binary': {'base64': 'sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==', 'subType': '00'}}, 'creationDate': {'$date': {'$numberLong': '1648914851981'}}, 'updateDate': {'$date': {'$numberLong': '1648914851981'}}, 'status': {'$numberInt': '0'}, 'masterKey': {'provider': 'local'}} ] tests: - description: "FLE2 Range Long. Update." clientOptions: autoEncryptOpts: kmsProviders: local: {'key': {'$binary': {'base64': 'Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk', 'subType': '00'}}} operations: - name: insertOne arguments: document: &doc0 { _id: 0, encryptedLong: { $numberLong: "0" } } - name: insertOne arguments: document: &doc1 { _id: 1, encryptedLong: { $numberLong: "1" } } - name: updateOne arguments: filter: { encryptedLong: { $gt: { $numberLong: "0" } } } update: { "$set": { "encryptedLong": { $numberLong: "2" } }} result: matchedCount: 1 modifiedCount: 1 upsertedCount: 0 expectations: - command_started_event: command: listCollections: 1 filter: name: *collection_name command_name: listCollections - command_started_event: command: find: datakeys filter: { "$or": [ { "_id": { "$in": [ {'$binary': {'base64': 'EjRWeBI0mHYSNBI0VniQEg==', 'subType': '04'}} ] } }, { "keyAltNames": { "$in": [] } } ] } $db: keyvault readConcern: { level: "majority" } command_name: find - command_started_event: command: insert: *collection_name documents: - &doc0_encrypted { "_id": 0, "encryptedLong": { $$type: "binData" } } ordered: true encryptionInformation: type: 1 schema: default.default: # libmongocrypt applies escCollection and ecocCollection to outgoing command. escCollection: "enxcol_.default.esc" ecocCollection: "enxcol_.default.ecoc" <<: *encrypted_fields command_name: insert - command_started_event: command: insert: *collection_name documents: - &doc1_encrypted { "_id": 1, "encryptedLong": { $$type: "binData" } } ordered: true encryptionInformation: type: 1 schema: default.default: # libmongocrypt applies escCollection and ecocCollection to outgoing command. escCollection: "enxcol_.default.esc" ecocCollection: "enxcol_.default.ecoc" <<: *encrypted_fields command_name: insert - command_started_event: command_name: update command: "update": "default" "ordered": true "updates": [ { "q": { "encryptedLong": { "$gt": { "$binary": { "base64": "DUkFAAADcGF5bG9hZAAZBQAABGcABQUAAAMwAH0AAAAFZAAgAAAAALGGQ/CRD+pGLD53BZzWcCcYbuGLVEyjzXIx7b+ux/q2BXMAIAAAAACOC6mXEZL27P9hethZbtKYsTXKK+FpgQ9Axxmn9N/cCwVsACAAAAAA+MFEd8XfZSpbXKqqPC2L3TEFswkaG5Ff6aSgf8p+XVIAAzEAfQAAAAVkACAAAAAAtL3QIvnZqCF72eS6lKr8ilff7R6kiNklokiTuaU5wNsFcwAgAAAAAEtqr3/X731VB+VrbFcY8ZrJKRo2E0Fd+C8L0EMNcvcCBWwAIAAAAABNPhSriux8W8qbwnhCczE3IzlhNEn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2k5Pz6OhvxdWNkDvDWJIja8wVzACAAAAAAOLypVKNxf/wR1G8OZjUUsTQzDYeNNhhITxGMSp7euS4FbAAgAAAAAA9EsxoV1B2DcQ1NJRwuxXnvVR+vkD0wbbDYEI/zFEnDAAM5AH0AAAAFZAAgAAAAAEocREw1L0g+roFUchJI2Yd0M0ME2bnErNUYnpyJP1SqBXMAIAAAAAAcE2/JK/8MoSeOchIuAkKh1X3ImoA7p8ujAZIfvIDo6QVsACAAAAAA+W0+zgLr85/PD7P9a94wk6MgNgrizx/XU9aCxAkp1IwAABJjbQAAAAAAAAAAAAAQcGF5bG9hZElkAAAAAAAQZmlyc3RPcGVyYXRvcgABAAAAAA==", "subType": "06" } } } }, "u": { "$set": { "encryptedLong": { $$type: "binData" } } } } ] encryptionInformation: type: 1 schema: "default.default": # libmongocrypt applies escCollection and ecocCollection to outgoing command. escCollection: "enxcol_.default.esc" ecocCollection: "enxcol_.default.ecoc" <<: *encrypted_fields "$db": "default" outcome: collection: # Outcome is checked using a separate MongoClient without auto encryption. data: - { "_id": 0, "encryptedLong": { $$type: "binData" }, "__safeContent__": [ { "$binary": { "base64": "5nRutVIyq7URVOVtbE4vM01APSIajAVnsShMwjBlzkM=", "subType": "00" } }, { "$binary": { "base64": "RjBYT2h3ZAoHxhf8DU6/dFbDkEBZp0IxREcsRTu2MXs=", "subType": "00" } }, { "$binary": { "base64": "x7GR49EN0t3WXQDihkrbonK7qNIBYC87tpL/XEUyIYc=", "subType": "00" } }, { "$binary": { "base64": "JfYUqWF+OoGjiYkRI4L5iPlF+T1Eleul7Fki22jp4Qc=", "subType": "00" } }, { "$binary": { "base64": "q1RyGfIgsaQHoZFRw+DD28V26rN5hweApPLwExncvT8=", "subType": "00" } }, { "$binary": { "base64": "L2PFeKGvLS6C+DLudR6fGlBq3ERPvjWvRyNRIA2HVb0=", "subType": "00" } }, { "$binary": { "base64": "CWxaNqL3iP1yCixDkcmf9bmW3E5VeN8TJkg1jJe528s=", "subType": "00" } }, { "$binary": { "base64": "+vC6araOEo+fpW7PSIP40/EnzBCj1d2N10Jr3rrXJJM=", "subType": "00" } }, { "$binary": { "base64": "6SV63Mf51Z6A6p2X3rCnJKCu6ku3Oeb45mBYbz+IoAo=", "subType": "00" } } ] } - { "_id": 1, "encryptedLong": { $$type: "binData" }, "__safeContent__": [ { "$binary": { "base64": "DLCAJs+W2PL2DV5YChCL6dYrQNr+j4p3L7xhVaub4ic=", "subType": "00" } }, { "$binary": { "base64": "hyDcE6QQjPrYJaIS/n7evEZFYcm31Tj89CpEYGF45cI=", "subType": "00" } }, { "$binary": { "base64": "F08nMDWDZc+DbWM7XCEJNNCEYyinRmrvGP7EWhmp4is=", "subType": "00" } }, { "$binary": { "base64": "cXH4688amcDc8kZOJq4UP8cE3R58Zl7e+Qo/1jyspps=", "subType": "00" } }, { "$binary": { "base64": "uURBxvTp3FBCVkd+LPqyuY7d6rMW6SGIJQEPY/wtkZI=", "subType": "00" } }, { "$binary": { "base64": "jG3hax1L3RBp9t38vUt53FsBxgr/+Si/vVISpAylYpE=", "subType": "00" } }, { "$binary": { "base64": "kwtIW8MhH9Ky5xNjBx8gFA/SHh2YVphie7g5FGBzals=", "subType": "00" } }, { "$binary": { "base64": "FHflwFuEMu4xX0ZApHi+pdlBH+oevAtXckCUb5Wv0xU=", "subType": "00" } }, { "$binary": { "base64": "ty4cnzJdAlbQKnh7px3GEYjBnvO+jIOaKjoTRDtmh3M=", "subType": "00" } } ] }