From 442c9fd89e698e50e59136e47a66f5936e17ac64 Mon Sep 17 00:00:00 2001 From: Bailey Pearson Date: Wed, 29 Mar 2023 09:35:33 -0400 Subject: [PATCH 1/2] fix broken range index test --- ...prose.22.range_explicit_encryption.test.ts | 43 ++++++++++--------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/test/integration/client-side-encryption/client_side_encryption.prose.22.range_explicit_encryption.test.ts b/test/integration/client-side-encryption/client_side_encryption.prose.22.range_explicit_encryption.test.ts index bcddcb7ea5f..f6603c7d147 100644 --- a/test/integration/client-side-encryption/client_side_encryption.prose.22.range_explicit_encryption.test.ts +++ b/test/integration/client-side-encryption/client_side_encryption.prose.22.range_explicit_encryption.test.ts @@ -222,27 +222,28 @@ describe('Range Explicit Encryption', function () { encryptedTwoHundred = await clientEncryption.encrypt(factory(200), opts); const key = `encrypted${dataType}`; - await encryptedClient - .db('db') - .collection('explicit_encryption') - .insertMany([ - { - [key]: encryptedZero, - _id: 0 - }, - { - [key]: encryptedSix, - _id: 1 - }, - { - [key]: encryptedThirty, - _id: 2 - }, - { - [key]: encryptedTwoHundred, - _id: 3 - } - ]); + const documents = [ + { + [key]: encryptedZero, + _id: 0 + }, + { + [key]: encryptedSix, + _id: 1 + }, + { + [key]: encryptedThirty, + _id: 2 + }, + { + [key]: encryptedTwoHundred, + _id: 3 + } + ]; + + for (const doc of documents) { + await encryptedClient.db('db').collection('explicit_encryption').insertOne(doc); + } await utilClient.close(); }); From f09e4b2d38629a1c72248ebf7f08a1e99e6f1e8a Mon Sep 17 00:00:00 2001 From: Bailey Pearson Date: Wed, 29 Mar 2023 11:57:39 -0400 Subject: [PATCH 2/2] Update client_side_encryption.prose.22.range_explicit_encryption.test.ts --- ...t_side_encryption.prose.22.range_explicit_encryption.test.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/integration/client-side-encryption/client_side_encryption.prose.22.range_explicit_encryption.test.ts b/test/integration/client-side-encryption/client_side_encryption.prose.22.range_explicit_encryption.test.ts index f6603c7d147..0b02de3fb6f 100644 --- a/test/integration/client-side-encryption/client_side_encryption.prose.22.range_explicit_encryption.test.ts +++ b/test/integration/client-side-encryption/client_side_encryption.prose.22.range_explicit_encryption.test.ts @@ -241,6 +241,8 @@ describe('Range Explicit Encryption', function () { } ]; + // Queryable encryption only supports single document inserts, so we must insert the documents + // one at a time. for (const doc of documents) { await encryptedClient.db('db').collection('explicit_encryption').insertOne(doc); }