You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As suggested in other issues, it's possible, and often recommended, to utilise Feathers service hooks instead. However, there are use cases when that option is not very fitting. An example is when you are re-using a single schema in several other schemas. Perhaps even nested on different levels in different models.
In such a use case, using service hooks would be very messy compared to a single, all-encompassing Mongoose pre validate/save/remove hook.
The text was updated successfully, but these errors were encountered:
Feature request
Support document middleware
Background
AFAIK, document middleware, such as mongoose pre-save hooks, are not supported. I'm assuming that this is because feathers-mongoose uses queries such as
findOneAndUpdate()
rather than loading the document and then saving it (see https://mongoosejs.com/docs/middleware.html#notes).As suggested in other issues, it's possible, and often recommended, to utilise Feathers service hooks instead. However, there are use cases when that option is not very fitting. An example is when you are re-using a single schema in several other schemas. Perhaps even nested on different levels in different models.
In such a use case, using service hooks would be very messy compared to a single, all-encompassing Mongoose pre validate/save/remove hook.
The text was updated successfully, but these errors were encountered: