Use virtual properties with Mongoose and MongoDB

Share this video with your friends

Send Tweet

Virtual properties are a great way to add some semantics to your data layer and abstract any shortcomings of the underlying schema. This lesson demonstrates virtual getters and setters in Mongoose, and how to integrate their use in your Express server.

Vlad
Vlad
~ 9 years ago

Could be worth doing a vide on how to replace final remaining calls that still use file system, e.g.: '*.json' '/data/:username' '/users/by/:gender'

Patrick
Patrick
~ 8 years ago

Just to be clear: in my app, the delete function does not work...is this correct? I'm not sure these videos actually showed a delete in action, but yet I see it in the code...I can update fine, but not delete. Want to make sure I am not doing something wrong...thanks,

Jan Kraus
Jan Kraus
~ 7 years ago

Your method didn't work because you only passed location object from the request body and never added name params.

~ 2 years ago

Very clear explanations. Thank you!