summaryrefslogtreecommitdiff
path: root/jstests/fle2
diff options
context:
space:
mode:
authorsergey.galtsev <sergey.galtsev@mongodb.com>2022-03-31 15:22:40 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-03-31 17:38:01 +0000
commit24e8f255b1f8b48594e6354912768682a04b8b1b (patch)
treef401c7facd48d2569fa17e557e36140bd9ce2757 /jstests/fle2
parent2d78530f2b590d205232bd3d65cb8f66500aa86f (diff)
downloadmongo-24e8f255b1f8b48594e6354912768682a04b8b1b.tar.gz
SERVER-63791 support unindexed fle2 encrypted fields
Diffstat (limited to 'jstests/fle2')
-rw-r--r--jstests/fle2/libs/encrypted_client_util.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/jstests/fle2/libs/encrypted_client_util.js b/jstests/fle2/libs/encrypted_client_util.js
index 501fee781c6..4a6a3a5a4dc 100644
--- a/jstests/fle2/libs/encrypted_client_util.js
+++ b/jstests/fle2/libs/encrypted_client_util.js
@@ -293,3 +293,15 @@ function assertIsIndexedEncryptedField(value) {
assert(value.hex().startsWith("07"),
"Expected subtype 7 but found the wrong type: " + value.hex());
}
+
+/**
+ * Assert a field is an unindexed encrypted field
+ *
+ * @param {BinData} value bindata value
+ */
+function assertIsUnindexedEncryptedField(value) {
+ assert(value instanceof BinData, "Expected BinData, found: " + value);
+ assert.eq(value.subtype(), 6, "Expected Encrypted bindata: " + value);
+ assert(value.hex().startsWith("06"),
+ "Expected subtype 6 but found the wrong type: " + value.hex());
+}