Skip to content

Commit 44735a3

Browse files
committed
fix(NODE-4271): drop main collection first
1 parent fc6d8a5 commit 44735a3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/operations/drop.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ export class DropCollectionOperation extends CommandOperation<boolean> {
5151
encryptedFields = listCollectionsResult?.[0]?.options?.encryptedFields;
5252
}
5353

54+
// Spec tests expect the main collection to be dropped first.
55+
const result = await this.executeWithoutEncryptedFieldsCheck(server, session);
56+
5457
if (encryptedFields) {
5558
const escCollection = encryptedFields.escCollection || `enxcol_.${name}.esc`;
5659
const eccCollection = encryptedFields.eccCollection || `enxcol_.${name}.ecc`;
@@ -71,8 +74,7 @@ export class DropCollectionOperation extends CommandOperation<boolean> {
7174
}
7275
}
7376
}
74-
75-
return await this.executeWithoutEncryptedFieldsCheck(server, session);
77+
return result;
7678
})().then(
7779
result => callback(undefined, result),
7880
err => callback(err)

0 commit comments

Comments
 (0)