summaryrefslogtreecommitdiff
path: root/src/mongo/crypto
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/mongo/crypto
parenta8a1844e893338f64664d7a82f6c9fc9845469f2 (diff)
downloadmongo-f5d681c10a192ecc50e6ac338a18440f1cd836af.tar.gz
SERVER-67200 Add a new range QueryType to EncryptedFieldConfig
Diffstat (limited to 'src/mongo/crypto')
-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
4 files changed, 25 insertions, 0 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"