-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Closed
Labels
new featureThis change adds new functionality, like a new method or classThis change adds new functionality, like a new method or class
Milestone
Description
I am not sure whether this is present or not, but it would be great if we have a way to optionally disable running middlewares, a couple of use cases that I could think of is for internal use in the library, this would help us avoid situations like #8739.
Other developers could also use this in their applications if they need to run a query without triggering middlewares, or inside the logic of the middleware in itself to avoid an infinite loop such as the custom option in #8756 (comment).
Considering the following API:
User.findOne({ name: 'John' }, null, { middlewares: false })Later on, we could make it so that the options accept an object
{ middlewares: { pre: true, post: false } }Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
new featureThis change adds new functionality, like a new method or classThis change adds new functionality, like a new method or class