Skip to content

Conversation

@vkarpov15
Copy link
Collaborator

Summary

One thing that's unfortunately missing from the driver API is the ability to set global plugins. Drivers can always do mongoose.plugin(myPlugin), but the problem is that assumes you only have one Mongoose instance. If a user were to do const mongoose = new Mongoose(); mongoose.setDriver(myDriver);, then there's no way for that driver to apply plugins to the new Mongoose instance.

With this PR, drivers can export a plugins array that setDriver() will look for, and apply plugins to the Mongoose instance.

Examples

@hasezoey hasezoey added this to the 8.5 milestone Jun 24, 2024
@vkarpov15 vkarpov15 merged commit 87c57e6 into 8.5 Jun 24, 2024
@hasezoey hasezoey deleted the vkarpov15/driver-plugins branch June 25, 2024 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants