Skip to content

Commit d2497a1

Browse files
authored
Merge pull request #11265 from Uzlopak/fix-removal-remark
remove obsolete code after upgrading to bson4
2 parents abcdb8e + 94570a6 commit d2497a1

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

lib/cast.js

-8
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,6 @@ module.exports = function cast(schema, obj, options, context) {
3636
return obj;
3737
}
3838

39-
// bson 1.x has the unfortunate tendency to remove filters that have a top-level
40-
// `_bsontype` property. But we should still allow ObjectIds because
41-
// `Collection#find()` has a special case to support `find(objectid)`.
42-
// Should remove this when we upgrade to bson 4.x. See gh-8222, gh-8268
43-
if (obj.hasOwnProperty('_bsontype') && obj._bsontype !== 'ObjectID') {
44-
delete obj._bsontype;
45-
}
46-
4739
if (schema != null && schema.discriminators != null && obj[schema.options.discriminatorKey] != null) {
4840
schema = getSchemaDiscriminatorByValue(schema, obj[schema.options.discriminatorKey]) || schema;
4941
}

0 commit comments

Comments
 (0)