-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Description
Do you want to request a feature or report a bug?
Feature Request
What is the current behavior?
Is there a way to disable a plugin for a specific model? I've enabled timestamps and toObject transforms for all my schemas using a plugin. Unfortunately, my subdocument schemas also end up using that plugin, I do not want my subdocs to have timestamps or be transformed. Is there a way to turn off a plugin for a specific schema? I know you can opt-in by assigning the plugin to each model, but is there an opt-out option?
Super naive first thought:
Maybe something like schema.prototype.skipPlugin(_nameOfPlugin_). Of course this would require plugins to be named, which could be useful..
Please mention your node.js, mongoose and MongoDB version.
All latest versions as of 12/27/2018