Chapter 5. Introduction to Mongoose

Mongoose is a robust Node.js ODM module that adds MongoDB support to your Express application. It uses schemas to model your entities, offers predefined validation along with custom validations, allows you to define virtual attributes, and uses middleware hooks to intercept operations. The Mongoose design goal is to bridge the gap between the MongoDB schemaless approach and the requirements of real-world application development. In this chapter, you'll go through the following basic features of Mongoose:

  • Mongoose schemas and models
  • Schema indexes, modifiers, and virtual attributes
  • Using the model's methods and performing CRUD operations
  • Verifying your data using predefined and custom validators
  • Using middleware to ...

Get MEAN Web Development - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.