Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for new mongoose middleware types #18

Open
linusbrolin opened this issue Jun 16, 2021 · 0 comments
Open

Support for new mongoose middleware types #18

linusbrolin opened this issue Jun 16, 2021 · 0 comments

Comments

@linusbrolin
Copy link

Mongoose has some new middleware types for both document and query:
https://mongoosejs.com/docs/middleware.html

New document middleware types:

  • deleteOne
  • updateOne
  • remove

New query middleware types:

  • deleteMany
  • deleteOne
  • findOneAndDelete
  • updateOne
  • updateMany

Most of these are basically aliases for existing middleware types, but there need to be hooks for them in historical.

Since some of the middleware types now exist for both document and query (for example updateOne and remove), there are some naming conflicts.
To fully support all kinds of middleware types, there are options for which kind each is for:
https://mongoosejs.com/docs/middleware.html#naming

The update and remove middleware types are deprecated, BUT they are still supported and very much in use, so they should still be included in historical.
https://mongoosejs.com/docs/deprecations.html

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

No branches or pull requests

1 participant