Lesson 14. Building models with Mongoose

In lesson 13, you got up and running with MongoDB. With a database connected to your Node.js application, you’re ready to save and load data. In this lesson, you apply a more object-oriented approach to your data. First, you install the Mongoose package, a tool that provides a syntactic layer between your application logic and your database. Mongoose allows you to convert your application data to fit a model structure. Later in the lesson, you build your first model and schema to represent newsletter subscribers to your recipe application.

This lesson covers

  • Installing and connecting Mongoose to your Node.js application
  • Creating a schema
  • Building and instantiating Mongoose data models
  • Loading and saving ...

Get Get Programming with Node.js now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.