diff options
Diffstat (limited to 'src/mongo')
-rw-r--r-- | src/mongo/crypto/encryption_fields.idl | 2 | ||||
-rw-r--r-- | src/mongo/crypto/encryption_fields_validation.cpp | 2 | ||||
-rw-r--r-- | src/mongo/crypto/fle_crypto.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/catalog/collection_options_test.cpp | 46 | ||||
-rw-r--r-- | src/mongo/db/commands/create_command.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/commands/set_feature_compatibility_version_command.cpp | 12 | ||||
-rw-r--r-- | src/mongo/db/fle_crud_test.cpp | 2 |
7 files changed, 34 insertions, 34 deletions
diff --git a/src/mongo/crypto/encryption_fields.idl b/src/mongo/crypto/encryption_fields.idl index 5eb13c5d700..4d1e84c28f9 100644 --- a/src/mongo/crypto/encryption_fields.idl +++ b/src/mongo/crypto/encryption_fields.idl @@ -53,7 +53,7 @@ enums: type: string values: Equality: "equality" - Range: "range" + RangePreview: "rangePreview" feature_flags: featureFlagFLE2Range: diff --git a/src/mongo/crypto/encryption_fields_validation.cpp b/src/mongo/crypto/encryption_fields_validation.cpp index 3c370136fb3..b873a7dfdf3 100644 --- a/src/mongo/crypto/encryption_fields_validation.cpp +++ b/src/mongo/crypto/encryption_fields_validation.cpp @@ -183,7 +183,7 @@ void validateEncryptedField(const EncryptedField* field) { "The field 'max' is not allowed for equality index but is present", !encryptedIndex.getMax().has_value()); break; - case QueryTypeEnum::Range: { + case QueryTypeEnum::RangePreview: { validateRangeIndex(fieldType, encryptedIndex); break; } diff --git a/src/mongo/crypto/fle_crypto.cpp b/src/mongo/crypto/fle_crypto.cpp index ac19c13c21f..512b61a6ef3 100644 --- a/src/mongo/crypto/fle_crypto.cpp +++ b/src/mongo/crypto/fle_crypto.cpp @@ -1917,7 +1917,7 @@ void FLEClientCrypto::validateDocument(const BSONObj& doc, subCdr, keyVault); auto tag = EDCServerCollection::generateTag(ieev); tags.insert({tag, field.first}); - } else if (hasQueryType(configField->second, QueryTypeEnum::Range)) { + } else if (hasQueryType(configField->second, QueryTypeEnum::RangePreview)) { uassert(6775316, str::stream() << "Field '" << field.first << "' is marked as range but not indexed", diff --git a/src/mongo/db/catalog/collection_options_test.cpp b/src/mongo/db/catalog/collection_options_test.cpp index 05db39ef3c6..cfe1b20f66e 100644 --- a/src/mongo/db/catalog/collection_options_test.cpp +++ b/src/mongo/db/catalog/collection_options_test.cpp @@ -657,7 +657,7 @@ TEST(FLECollectionOptions, Range_AllowedTypes) { "path": "firstName", "keyId": { '$uuid': '5f34e99a-b214-451f-b6f6-d3d28e933d15' }, "bsonType": "int", - "queries": {"queryType": "range", "sparsity" : 1, min : 1, max : 2} + "queries": {"queryType": "rangePreview", "sparsity" : 1, min : 1, max : 2} } ] } @@ -671,7 +671,7 @@ TEST(FLECollectionOptions, Range_AllowedTypes) { "path": "firstName", "keyId": { '$uuid': '5f34e99a-b214-451f-b6f6-d3d28e933d15' }, "bsonType": "long", - "queries": {"queryType": "range", "sparsity" : 1, min : {$numberLong: "1"}, max : {$numberLong: "2"}} + "queries": {"queryType": "rangePreview", "sparsity" : 1, min : {$numberLong: "1"}, max : {$numberLong: "2"}} } ] } @@ -686,7 +686,7 @@ TEST(FLECollectionOptions, Range_AllowedTypes) { "path": "firstName", "keyId": { '$uuid': '5f34e99a-b214-451f-b6f6-d3d28e933d15' }, "bsonType": ")" << type << R"(", - "queries": {"queryType": "range", "sparsity" : 1} + "queries": {"queryType": "rangePreview", "sparsity" : 1} } ] } @@ -703,7 +703,7 @@ TEST(FLECollectionOptions, Range_AllowedTypes) { "bsonType": ")" << "double" << R"(", - "queries": {"queryType": "range", "sparsity" : 1, min: 0.000, max: 1.000, precision: 3} + "queries": {"queryType": "rangePreview", "sparsity" : 1, min: 0.000, max: 1.000, precision: 3} } ] } @@ -719,7 +719,7 @@ TEST(FLECollectionOptions, Range_AllowedTypes) { "bsonType": ")" << "decimal" << R"(", - "queries": {"queryType": "range", "sparsity" : 1, min: NumberDecimal("0.000"), max: NumberDecimal("1.000"), precision: 3} + "queries": {"queryType": "rangePreview", "sparsity" : 1, min: NumberDecimal("0.000"), max: NumberDecimal("1.000"), precision: 3} } ] } @@ -734,7 +734,7 @@ TEST(FLECollectionOptions, Range_AllowedTypes) { "path": "firstName", "keyId": { '$uuid': '5f34e99a-b214-451f-b6f6-d3d28e933d15' }, "bsonType": "date", - "queries": {"queryType": "range", "sparsity" : 1, min : {"$date": {"$numberLong": "12344"}}, max : {"$date": {"$numberLong": "12345"}}} + "queries": {"queryType": "rangePreview", "sparsity" : 1, min : {"$date": {"$numberLong": "12344"}}, max : {"$date": {"$numberLong": "12345"}}} } ] } @@ -773,7 +773,7 @@ TEST(FLECollectionOptions, Range_DisAllowedTypes) { "path": "firstName", "keyId": { '$uuid': '5f34e99a-b214-451f-b6f6-d3d28e933d15' }, "bsonType": ")" << type << R"(", - "queries": {"queryType": "range"} + "queries": {"queryType": "rangePreview"} } ] } @@ -792,7 +792,7 @@ TEST(FLECollectionOptions, Range_MissingFields) { "path": "firstName", "keyId": { '$uuid': '5f34e99a-b214-451f-b6f6-d3d28e933d15' }, "bsonType": "int", - "queries": {"queryType": "range"} + "queries": {"queryType": "rangePreview"} } ] } @@ -805,7 +805,7 @@ TEST(FLECollectionOptions, Range_MissingFields) { "path": "firstName", "keyId": { '$uuid': '5f34e99a-b214-451f-b6f6-d3d28e933d15' }, "bsonType": "int", - "queries": {"queryType": "range", sparsity: 1} + "queries": {"queryType": "rangePreview", sparsity: 1} } ] } @@ -818,7 +818,7 @@ TEST(FLECollectionOptions, Range_MissingFields) { "path": "firstName", "keyId": { '$uuid': '5f34e99a-b214-451f-b6f6-d3d28e933d15' }, "bsonType": "int", - "queries": {"queryType": "range", sparsity: 1, min : 1} + "queries": {"queryType": "rangePreview", sparsity: 1, min : 1} } ] } @@ -883,7 +883,7 @@ TEST(FLECollectionOptions, Range_MinMax) { << "int" << "queries" << BSON("queryType" - << "range" + << "rangePreview" << "sparsity" << 1 << "min" << 2 << "max" << 1))))); @@ -898,7 +898,7 @@ TEST(FLECollectionOptions, Range_MinMax) { << "long" << "queries" << BSON("queryType" - << "range" + << "rangePreview" << "sparsity" << 1 << "min" << 2LL << "max" << 1LL))))); @@ -914,7 +914,7 @@ TEST(FLECollectionOptions, Range_MinMax) { << "double" << "queries" << BSON("queryType" - << "range" + << "rangePreview" << "sparsity" << 1 << "min" << 2.0))))); ASSERT_STATUS_CODE(6967100, CollectionOptions::parse(doc)); @@ -926,7 +926,7 @@ TEST(FLECollectionOptions, Range_MinMax) { << "double" << "queries" << BSON("queryType" - << "range" + << "rangePreview" << "sparsity" << 1 << "max" << 2.0))))); ASSERT_STATUS_CODE(6967100, CollectionOptions::parse(doc)); @@ -939,7 +939,7 @@ TEST(FLECollectionOptions, Range_MinMax) { << "double" << "queries" << BSON("queryType" - << "range" + << "rangePreview" << "sparsity" << 1 << "precision" << 2))))); ASSERT_STATUS_CODE(6967100, CollectionOptions::parse(doc)); @@ -952,7 +952,7 @@ TEST(FLECollectionOptions, Range_MinMax) { << "decimal" << "queries" << BSON("queryType" - << "range" + << "rangePreview" << "sparsity" << 1 << "min" << Decimal128(2.0)))))); ASSERT_STATUS_CODE(6967100, CollectionOptions::parse(doc)); @@ -965,7 +965,7 @@ TEST(FLECollectionOptions, Range_MinMax) { << "decimal" << "queries" << BSON("queryType" - << "range" + << "rangePreview" << "sparsity" << 1 << "max" << Decimal128(2.0)))))); ASSERT_STATUS_CODE(6967100, CollectionOptions::parse(doc)); @@ -978,7 +978,7 @@ TEST(FLECollectionOptions, Range_MinMax) { << "decimal" << "queries" << BSON("queryType" - << "range" + << "rangePreview" << "sparsity" << 1 << "precision" << 2))))); ASSERT_STATUS_CODE(6967100, CollectionOptions::parse(doc)); @@ -995,7 +995,7 @@ TEST(FLECollectionOptions, Range_MinMax) { << "date" << "queries" << BSON("queryType" - << "range" + << "rangePreview" << "sparsity" << 1 << "min" << end << "max" << start))))); @@ -1011,7 +1011,7 @@ TEST(FLECollectionOptions, Range_BoundTypeMismatch) { "path": "firstName", "keyId": { '$uuid': '5f34e99a-b214-451f-b6f6-d3d28e933d15' }, "bsonType": "int", - "queries": {"queryType": "range", "sparsity" : 1, min: {"$numberLong": "12344"}, max: {"$numberLong": "123440"}} + "queries": {"queryType": "rangePreview", "sparsity" : 1, min: {"$numberLong": "12344"}, max: {"$numberLong": "123440"}} } ] } @@ -1024,7 +1024,7 @@ TEST(FLECollectionOptions, Range_BoundTypeMismatch) { "path": "firstName", "keyId": { '$uuid': '5f34e99a-b214-451f-b6f6-d3d28e933d15' }, "bsonType": "long", - "queries": {"queryType": "range", "sparsity" : 1, min: 1, max: 2} + "queries": {"queryType": "rangePreview", "sparsity" : 1, min: 1, max: 2} } ] } @@ -1037,7 +1037,7 @@ TEST(FLECollectionOptions, Range_BoundTypeMismatch) { "path": "firstName", "keyId": { '$uuid': '5f34e99a-b214-451f-b6f6-d3d28e933d15' }, "bsonType": "long", - "queries": {"queryType": "range", "sparsity" : 1, min: {$numberLong: "1"}, max: 2} + "queries": {"queryType": "rangePreview", "sparsity" : 1, min: {$numberLong: "1"}, max: 2} } ] } @@ -1049,7 +1049,7 @@ TEST(FLECollectionOptions, Range_BoundTypeMismatch) { "path": "firstName", "keyId": { '$uuid': '5f34e99a-b214-451f-b6f6-d3d28e933d15' }, "bsonType": "int", - "queries": {"queryType": "range", "sparsity" : 1, min: 1, max: {"$numberLong": "123440"}} + "queries": {"queryType": "rangePreview", "sparsity" : 1, min: 1, max: {"$numberLong": "123440"}} } ] } diff --git a/src/mongo/db/commands/create_command.cpp b/src/mongo/db/commands/create_command.cpp index f480980fa0b..bcefed128b2 100644 --- a/src/mongo/db/commands/create_command.cpp +++ b/src/mongo/db/commands/create_command.cpp @@ -196,7 +196,7 @@ public: repl::ReplicationCoordinator::get(opCtx)->getReplicationMode() == repl::ReplicationCoordinator::Mode::modeReplSet); - if (hasQueryType(cmd.getEncryptedFields().get(), QueryTypeEnum::Range)) { + if (hasQueryType(cmd.getEncryptedFields().get(), QueryTypeEnum::RangePreview)) { uassert( 6775220, "Queryable Encryption Range support is only supported when FCV supports " diff --git a/src/mongo/db/commands/set_feature_compatibility_version_command.cpp b/src/mongo/db/commands/set_feature_compatibility_version_command.cpp index dc2e1ffb7c0..5e905303a35 100644 --- a/src/mongo/db/commands/set_feature_compatibility_version_command.cpp +++ b/src/mongo/db/commands/set_feature_compatibility_version_command.cpp @@ -699,12 +699,12 @@ private: opCtx, dbName, MODE_X, [&](const CollectionPtr& collection) { auto& efc = collection->getCollectionOptions().encryptedFieldConfig; - uassert( - ErrorCodes::CannotDowngrade, - str::stream() - << "Cannot downgrade the cluster as collection " << collection->ns() - << " has 'encryptedFields' with range indexes", - !(efc.has_value() && hasQueryType(efc.get(), QueryTypeEnum::Range))); + uassert(ErrorCodes::CannotDowngrade, + str::stream() << "Cannot downgrade the cluster as collection " + << collection->ns() + << " has 'encryptedFields' with range indexes", + !(efc.has_value() && + hasQueryType(efc.get(), QueryTypeEnum::RangePreview))); return true; }); } diff --git a/src/mongo/db/fle_crud_test.cpp b/src/mongo/db/fle_crud_test.cpp index 8f87fd44863..2d5966c6305 100644 --- a/src/mongo/db/fle_crud_test.cpp +++ b/src/mongo/db/fle_crud_test.cpp @@ -407,7 +407,7 @@ EncryptedFieldConfig getTestEncryptedFieldConfig( , "path": "encrypted", "bsonType": "int", - "queries": {"queryType": "range", "min": 0, "max": 15, "sparsity": 1} + "queries": {"queryType": "rangePreview", "min": 0, "max": 15, "sparsity": 1} } ] |