We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d502eb0 commit aa4f5c0Copy full SHA for aa4f5c0
1 file changed
src/operations/find.ts
@@ -93,16 +93,6 @@ export class FindOperation extends CommandOperation<Document> {
93
throw new MongoInvalidArgumentError('Query filter must be a plain object or ObjectId');
94
}
95
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
-
106
// special case passing in an ObjectId as a filter
107
this.filter = filter != null && filter._bsontype === 'ObjectId' ? { _id: filter } : filter;
108
0 commit comments