summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorReilly McBride <reilly.mcbride@mongodb.com>2022-07-08 17:25:06 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-07-08 18:35:10 +0000
commitf5d681c10a192ecc50e6ac338a18440f1cd836af (patch)
treeac896261c73bf1b59d0f5825b18d1f7697af0a82 /src
parenta8a1844e893338f64664d7a82f6c9fc9845469f2 (diff)
downloadmongo-f5d681c10a192ecc50e6ac338a18440f1cd836af.tar.gz
SERVER-67200 Add a new range QueryType to EncryptedFieldConfig
Diffstat (limited to 'src')
-rw-r--r--src/mongo/crypto/SConscript1
-rw-r--r--src/mongo/crypto/encryption_fields.idl18
-rw-r--r--src/mongo/crypto/encryption_fields_util.h5
-rw-r--r--src/mongo/crypto/fle_field_schema.idl1
-rw-r--r--src/mongo/db/catalog/SConscript2
-rw-r--r--src/mongo/db/pipeline/SConscript13
6 files changed, 38 insertions, 2 deletions
diff --git a/src/mongo/crypto/SConscript b/src/mongo/crypto/SConscript
index b6a3453a16d..459e8fccc82 100644
--- a/src/mongo/crypto/SConscript
+++ b/src/mongo/crypto/SConscript
@@ -81,6 +81,7 @@ env.Library(
"encryption_fields.idl",
],
LIBDEPS=[
+ '$BUILD_DIR/mongo/db/pipeline/value_idl',
'$BUILD_DIR/mongo/idl/feature_flag',
'$BUILD_DIR/mongo/idl/idl_parser',
],
diff --git a/src/mongo/crypto/encryption_fields.idl b/src/mongo/crypto/encryption_fields.idl
index d40c9153ee6..aba9459f20e 100644
--- a/src/mongo/crypto/encryption_fields.idl
+++ b/src/mongo/crypto/encryption_fields.idl
@@ -30,6 +30,7 @@ global:
imports:
- "mongo/idl/basic_types.idl"
+ - "mongo/db/pipeline/value.idl"
enums:
QueryType:
@@ -37,6 +38,7 @@ enums:
type: string
values:
Equality: "equality"
+ Range: "range"
feature_flags:
featureFlagFLE2:
@@ -66,6 +68,22 @@ structs:
default: 4
unstable: true
validator: { gte: 0 }
+ min:
+ description: "Defines the lower bound for field values. Only applicable for queryType range"
+ type: Value
+ optional: true
+ unstable: true
+ max:
+ description: "Defines the upper bound for field values. Only applicable for queryType range"
+ type: Value
+ optional: true
+ unstable: true
+ sparsity:
+ description: "Lower value - higher storage overhead, faster query."
+ type: int
+ default: 0
+ unstable: true
+ validator: { gte: 0, lte: 3 }
EncryptedField:
description: "Information about encrypted fields"
diff --git a/src/mongo/crypto/encryption_fields_util.h b/src/mongo/crypto/encryption_fields_util.h
index e53e1ff445a..a06a75fc5fa 100644
--- a/src/mongo/crypto/encryption_fields_util.h
+++ b/src/mongo/crypto/encryption_fields_util.h
@@ -76,6 +76,11 @@ inline bool isFLE2EqualityIndexedSupportedType(BSONType type) {
}
}
+
+inline bool isFLE2RangeIndexedSupportedType(BSONType type) {
+ return true;
+}
+
inline bool isFLE2UnindexedSupportedType(BSONType type) {
switch (type) {
case BinData:
diff --git a/src/mongo/crypto/fle_field_schema.idl b/src/mongo/crypto/fle_field_schema.idl
index d9e2b54b890..9ee522f367b 100644
--- a/src/mongo/crypto/fle_field_schema.idl
+++ b/src/mongo/crypto/fle_field_schema.idl
@@ -77,6 +77,7 @@ enums:
values:
kUnindexed: 1
kEquality: 2
+ kRange: 3
Fle2PlaceholderType:
description: "The type of payload to generate from a placeholder"
diff --git a/src/mongo/db/catalog/SConscript b/src/mongo/db/catalog/SConscript
index d30c944fd9e..5cedf026f8d 100644
--- a/src/mongo/db/catalog/SConscript
+++ b/src/mongo/db/catalog/SConscript
@@ -37,11 +37,11 @@ env.Library(
'collection_options_validation.cpp',
],
LIBDEPS=[
+ '$BUILD_DIR/mongo/crypto/encrypted_field_config',
'$BUILD_DIR/mongo/db/pipeline/change_stream_pre_and_post_images_options',
],
LIBDEPS_PRIVATE=[
'$BUILD_DIR/mongo/base',
- '$BUILD_DIR/mongo/crypto/encrypted_field_config',
'$BUILD_DIR/mongo/db/common',
'$BUILD_DIR/mongo/db/query/collation/collator_interface',
'$BUILD_DIR/mongo/db/query/query_knobs',
diff --git a/src/mongo/db/pipeline/SConscript b/src/mongo/db/pipeline/SConscript
index 47f5acb67d7..ee68344f22c 100644
--- a/src/mongo/db/pipeline/SConscript
+++ b/src/mongo/db/pipeline/SConscript
@@ -475,7 +475,6 @@ env.Library(
'exchange_spec.idl',
'resume_token.cpp',
'storage_stats_spec.idl',
- 'value.idl',
],
LIBDEPS=[
'$BUILD_DIR/mongo/base',
@@ -484,6 +483,18 @@ env.Library(
'$BUILD_DIR/mongo/idl/idl_parser',
'$BUILD_DIR/mongo/s/common_s',
'runtime_constants_idl',
+ 'value_idl',
+ ],
+)
+
+env.Library(
+ target='value_idl',
+ source=[
+ 'value.idl',
+ ],
+ LIBDEPS=[
+ '$BUILD_DIR/mongo/db/exec/document_value/document_value',
+ '$BUILD_DIR/mongo/idl/idl_parser',
],
)