2022-08-05 10:10:55 -04:00
|
|
|
// Verify create encrypted collection with range index works
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @tags: [
|
2024-03-13 12:58:22 -04:00
|
|
|
* requires_fcv_80,
|
2025-01-29 18:08:38 +01:00
|
|
|
* assumes_unsharded_collection,
|
|
|
|
|
* assumes_balancer_off,
|
2022-08-05 10:10:55 -04:00
|
|
|
* ]
|
|
|
|
|
*/
|
2025-08-21 10:17:44 -07:00
|
|
|
let dbTest = db.getSiblingDB("create_range_encrypted_collection_db");
|
2022-08-05 10:10:55 -04:00
|
|
|
|
|
|
|
|
dbTest.basic.drop();
|
|
|
|
|
|
|
|
|
|
const sampleEncryptedFields = {
|
|
|
|
|
"fields": [
|
|
|
|
|
{
|
|
|
|
|
"path": "firstName",
|
|
|
|
|
"keyId": UUID("11d58b8a-0c6c-4d69-a0bd-70c6d9befae9"),
|
|
|
|
|
"bsonType": "int",
|
2025-08-21 10:17:44 -07:00
|
|
|
"queries": {"queryType": "range", "sparsity": 1, min: NumberInt(1), max: NumberInt(2)},
|
2022-08-05 10:10:55 -04:00
|
|
|
},
|
2025-08-21 10:17:44 -07:00
|
|
|
],
|
2022-08-05 10:10:55 -04:00
|
|
|
};
|
|
|
|
|
|
2024-03-13 12:58:22 -04:00
|
|
|
assert.commandWorked(dbTest.createCollection("basic", {encryptedFields: sampleEncryptedFields}));
|