Skip to content

Commit aa4f5c0

Browse files
chore(NODE-5133): remove broken filter as binary from find operation (#3641)
Co-authored-by: Durran Jordan <durran@gmail.com>
1 parent d502eb0 commit aa4f5c0

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

src/operations/find.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -93,16 +93,6 @@ export class FindOperation extends CommandOperation<Document> {
9393
throw new MongoInvalidArgumentError('Query filter must be a plain object or ObjectId');
9494
}
9595

96-
// If the filter is a buffer, validate that is a valid BSON document
97-
if (Buffer.isBuffer(filter)) {
98-
const objectSize = filter[0] | (filter[1] << 8) | (filter[2] << 16) | (filter[3] << 24);
99-
if (objectSize !== filter.length) {
100-
throw new MongoInvalidArgumentError(
101-
`Query filter raw message size does not match message header size [${filter.length}] != [${objectSize}]`
102-
);
103-
}
104-
}
105-
10696
// special case passing in an ObjectId as a filter
10797
this.filter = filter != null && filter._bsontype === 'ObjectId' ? { _id: filter } : filter;
10898
}

0 commit comments

Comments
 (0)