Need Assistance?

support@tutorialshub.in

Mongoose Middleware, Virtuals & Population

Mongoose Pre & Post Hooks

ADVERTISEMENT
MongoDB Free Lesson
5 min read
ADVERTISEMENT

Mongoose middleware (hooks) let you run logic automatically before (pre) or after (post) actions like save, find, or deleteOne. A classic use case is hashing a user's password before saving it.

ADVERTISEMENT
Hi, I'm Tuby! Here to help you