Chapter 10. Complex Schemas

In this chapter, we will explore the ways in which Mongoose can help you manage more complex data models. MongoDB is not a relational database, so there are no SQL-style JOIN commands. Instead, we will introduce the concepts of population and subdocuments, exploring how they are used.

By the end of this chapter, you will understand the differences between the two, and when each type is appropriate. We will also have added examples to our MongoosePM application.

Population – references to other collections

MongoDB and Mongoose do not support JOIN commands as MongoDB is not a relational database. Mongoose gives you an elegant way to achieve similar functionality by using population.


The concept of Population was dramatically ...

Get Mongoose for Application Development now with O’Reilly online learning.

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