historical
historical copied to clipboard
Support for new mongoose middleware types
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