Use mongodb exported bson instead of mongoose to import bson separately? #15154
Open
Description
Prerequisites
- I have written a descriptive issue title
- I have searched existing issues to ensure the feature has not already been requested
🚀 Feature Proposal
When using chrome's memory to do a snapshot analysis of node.js references, I found that the bson library takes up a lot of memory, about 3-4M (estimated), especially if the project may reference multiple bson libraries.
I see that mongodb already has an API for exporting bson, so why does mongoose have to reference bson separately?
If I use mongodb's bson, then I can reference a mongoose, and I don't need to bring in mongodb and its dependent bson libraries.
It would be more memory efficient.
Motivation
No response
Example
No response