Summary
In this chapter, you met the robust Mongoose model. You connected to your MongoDB instance and created your first Mongoose schema and model. You also learned how to validate your data and modify it using Schema modifiers and Mongoose middleware. You were introduced to virtual attributes and modifiers, and you learned to use them to change the representation of your documents. You also discovered the MongoDB DBRef feature and the way Mongoose utilizes that feature. In the next chapter, we'll go over the Passport authentication module, which will use your User
model to address user authentication.