Skip to content

How to implement afterSave hook? #19

@jacobq

Description

@jacobq

I would like to call some Mongoose Model instance methods after POST/PATCH request succeeds. Right now the only way I see to do this is to put in some kind of hack in beforeSave that schedules a callback later and queries the database using a unique attr, which is obviously not elegant at all. What built-in hooks are there that might be better suited for this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions