Skip to content

Commit d6821bf

Browse files
test(NODE-5149): fix broken range index test (#3617)
1 parent 79d774e commit d6821bf

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
@@ -224,27 +224,30 @@ describe('Range Explicit Encryption', function () {
224224
encryptedTwoHundred = await clientEncryption.encrypt(factory(200), opts);
225225

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

249252
await utilClient.close();
250253
});

0 commit comments

Comments
 (0)