- We’re using the deprecated https://www.npmjs.com/package/mongodb-extended-json package for EJSON handling in Compass, rather than the methods provided by the bson package itself
- This package looks at the name of the constructor of the $id field of DBRefs when serializing them: https://github.com/mongodb-js/extended-json/blob/7b1cd35224ee6da46d130d679c7bdfeda82eb4bb/lib/modes/strict.js#L34
- With the 4.0 driver update, the bson library used for objects coming from the driver was bumped from 1.x to 4.x
- With the bson library update, the constructor name changed from ObjectID to ObjectId , so mongodb-extended-json fails to recognize ObjectIds in this position
We should change the deprecated mongodb-extended-json package to use _bsontype instead of constructor.name as a quick fix.
- is related to
-
COMPASS-4927 Remove mongodb-extended-json usage
- Closed