Skip to content

Disabling/Skipping plugins #7376

@govindrai

Description

@govindrai

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionIf you have any thoughts or comments on this issue, please share them!

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions