[X] I have searched existing issues to ensure the feature has not already been requested
🚀 Feature Proposal
We did some work to in 6.4 to improve support for alternative drivers: using something other than the MongoDB Node driver to store data and execute queries. One potential application is an in-memory driver: when you call create(), the in-memory driver will store the document in memory rather than storing it in MongoDB, and find() will search through the in-memory data structure rather than executing a MongoDB query.
Motivation
There's a couple of use cases for this:
Much faster test suites, and easier to set up CI workflows.
Easier to create a playground on mongoosejs.com (#10970), because in that case we don't have to set up a MongoDB instance or Node.js server to execute Mongoose code. We can just run the code directly in the browser.
Prerequisites
🚀 Feature Proposal
We did some work to in 6.4 to improve support for alternative drivers: using something other than the MongoDB Node driver to store data and execute queries. One potential application is an in-memory driver: when you call
create()
, the in-memory driver will store the document in memory rather than storing it in MongoDB, andfind()
will search through the in-memory data structure rather than executing a MongoDB query.Motivation
There's a couple of use cases for this:
Example
mongoose.setDriver(require('@mongoosejs/in-memory-driver'))