Skip to content

[QUESTION]: isEqual and mongodb ObjectId #5895

Closed Answered by simplecommerce
simplecommerce asked this question in Q&A

You must be logged in to vote

I just got an update from MongoDB and here is what they said:

Such discrepancy in behaviour starting from 5.0.0 is due to a change in how BSON is bundled starting from bson@5.0.0. We now provide two BSON bundles:

One in CommonJS.
One as ESM (ECMAScript Module).
The mongodb package uses and re-exports the CommonJS BSON package. However, since your reproduction is written in ESM syntax, it is importing the ESM BSON bundle. This results in two copies of the BSON library being pulled into memory simultaneously. This discrepancy can be remedied by ensuring that only one instance of the BSON library is used.

For example, importing BSON from "mongodb" instead of from "bson" would result in both …

Replies: 1 comment

You must be logged in to vote
0 replies
Answer selected by simplecommerce
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant