From 4929faf34e5d9e3bd1a19b66738a0583610d7eab Mon Sep 17 00:00:00 2001 From: Bailey Pearson Date: Thu, 13 Apr 2023 14:58:28 -0400 Subject: [PATCH] remove broken filter as binary from find operation --- src/operations/find.ts | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/operations/find.ts b/src/operations/find.ts index 4a0f0a03ba5..d2c115ede33 100644 --- a/src/operations/find.ts +++ b/src/operations/find.ts @@ -93,16 +93,6 @@ export class FindOperation extends CommandOperation { throw new MongoInvalidArgumentError('Query filter must be a plain object or ObjectId'); } - // If the filter is a buffer, validate that is a valid BSON document - if (Buffer.isBuffer(filter)) { - const objectSize = filter[0] | (filter[1] << 8) | (filter[2] << 16) | (filter[3] << 24); - if (objectSize !== filter.length) { - throw new MongoInvalidArgumentError( - `Query filter raw message size does not match message header size [${filter.length}] != [${objectSize}]` - ); - } - } - // special case passing in an ObjectId as a filter this.filter = filter != null && filter._bsontype === 'ObjectId' ? { _id: filter } : filter; }