summaryrefslogtreecommitdiff
path: root/src/mongo/db
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2022-11-08 10:41:36 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-11-09 17:58:40 +0000
commit484eee157ecc039fafbbef6a4aae0286c8bbc3b5 (patch)
tree2d557432371a21d287e678bc1a8867e47e15659d /src/mongo/db
parent2bba15b5d79b1b33b2de267149177d04b02a1b79 (diff)
downloadmongo-484eee157ecc039fafbbef6a4aae0286c8bbc3b5.tar.gz
SERVER-71149 Rename queryType range to rangePreview
Diffstat (limited to 'src/mongo/db')
-rw-r--r--src/mongo/db/catalog/collection_options_test.cpp46
-rw-r--r--src/mongo/db/commands/create_command.cpp2
-rw-r--r--src/mongo/db/commands/set_feature_compatibility_version_command.cpp12
-rw-r--r--src/mongo/db/fle_crud_test.cpp2
4 files changed, 31 insertions, 31 deletions
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}
}
]