Skip to content

Commit b038cbb

Browse files
test(NODE-5147): fix broken range index test (#3612)
1 parent eb836bb commit b038cbb

File tree

1 file changed

+24
-21
lines changed

1 file changed

+24
-21
lines changed

test/integration/client-side-encryption/client_side_encryption.prose.22.range_explicit_encryption.test.ts

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -222,27 +222,30 @@ describe('Range Explicit Encryption', function () {
222222
encryptedTwoHundred = await clientEncryption.encrypt(factory(200), opts);
223223

224224
const key = `encrypted${dataType}`;
225-
await encryptedClient
226-
.db('db')
227-
.collection('explicit_encryption')
228-
.insertMany([
229-
{
230-
[key]: encryptedZero,
231-
_id: 0
232-
},
233-
{
234-
[key]: encryptedSix,
235-
_id: 1
236-
},
237-
{
238-
[key]: encryptedThirty,
239-
_id: 2
240-
},
241-
{
242-
[key]: encryptedTwoHundred,
243-
_id: 3
244-
}
245-
]);
225+
const documents = [
226+
{
227+
[key]: encryptedZero,
228+
_id: 0
229+
},
230+
{
231+
[key]: encryptedSix,
232+
_id: 1
233+
},
234+
{
235+
[key]: encryptedThirty,
236+
_id: 2
237+
},
238+
{
239+
[key]: encryptedTwoHundred,
240+
_id: 3
241+
}
242+
];
243+
244+
// Queryable encryption only supports single document inserts, so we must insert the documents
245+
// one at a time.
246+
for (const doc of documents) {
247+
await encryptedClient.db('db').collection('explicit_encryption').insertOne(doc);
248+
}
246249

247250
await utilClient.close();
248251
});

0 commit comments

Comments
 (0)