© Subhashini Chellappan and Dharanitharan Ganesan 2020
S. Chellappan, D. GanesanMongoDB Recipeshttps://doi.org/10.1007/978-1-4842-4891-1_3

3. Data Modeling and Aggregation

Subhashini Chellappan1  and Dharanitharan Ganesan2
(1)
Bangalore, India
(2)
Krishnagiri, Tamil Nadu, India
 
In Chapter 2, we discussed MongoDB CRUD operations, embedded documents, and arrays. In this chapter, we cover the following topics.
  • Data models.

  • Data model relationship between documents.

  • Modeling tree structures.

  • Aggregation operations.

  • SQL aggregation terms and corresponding MongoDB aggregation operations.

Data Models

MongoDB provides two data model designs for data modeling:
  • Embedded data models.

  • Normalized data models.

Embedded Data Models

In MongoDB, you can embed related data in a ...

Get MongoDB Recipes: With Data Modeling and Query Building Strategies 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.