mongoose-lifecycle icon indicating copy to clipboard operation
mongoose-lifecycle copied to clipboard

added hooks for Schemas

Open shri opened this issue 10 years ago • 1 comments

Hi Francois,

For architectural purposes at Kimono Labs, we wanted to be able to add a post "insertAfter" hook on the schema rather than the model, which kept us from repeating code in an application where schemas were utilized in multiple files.

What are your thoughts? I temporarily created a mongoose-lifecycle2 package but will definitely take it down if this PR is integrated. Tests and documentation has yet to be made.

Cheers, Shri

shri avatar Sep 05 '14 20:09 shri

I agree that it would be useful to have these lifecycle events at the schema level as well as model.

cryptojuice avatar Mar 24 '15 15:03 cryptojuice