Need Assistance?

support@tutorialshub.in

Mongoose Middleware, Virtuals & Population

Virtual Properties & Instance Methods

ADVERTISEMENT
MongoDB Free Lesson
5 min read
ADVERTISEMENT

Virtuals are computed properties that exist on Mongoose documents at runtime (like fullName) without being stored in MongoDB. Enable { toJSON: { virtuals: true } } on the schema to include them in API responses.

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