From 24e8f255b1f8b48594e6354912768682a04b8b1b Mon Sep 17 00:00:00 2001 From: "sergey.galtsev" Date: Thu, 31 Mar 2022 15:22:40 +0000 Subject: SERVER-63791 support unindexed fle2 encrypted fields --- jstests/fle2/libs/encrypted_client_util.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'jstests/fle2') 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()); +} -- cgit v1.2.1