O'Reilly logo

Getting MEAN with Mongo, Express, Angular, and Node by Simon Holmes

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5. Building a data model with MongoDB and Mongoose

This chapter covers

  • How Mongoose helps bridge an Express/Node application to a MongoDB database
  • Defining schemas for a data model using Mongoose
  • Connecting an application to a database
  • Managing databases using the MongoDB shell
  • Pushing a database into a live environment
  • Using the correct database depending on the environment, distinguishing between local and live versions of an application

In chapter 4 we ended up by moving our data out of the views and backward down the MVC path into the controllers. Ultimately, the controllers will pass data to the views, but they shouldn’t store it. Figure 5.1 recaps the data flow in an MVC pattern.

Figure 5.1. In an MVC pattern, data is ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required