From the course: Data Modeling in MongoDB
Unlock the full course today
Join today to access over 25,200 courses taught by industry experts.
Summary and partial documents - MongoDB Tutorial
From the course: Data Modeling in MongoDB
Summary and partial documents
- [Instructor] In this lesson, we'll be diving into some use cases for summarizing computing and even duplicating data within our documents. Yes, duplication. As you'll see, it's okay to embrace some amount of duplication in our documents and data models. Let's remind ourselves of the target that we're diving into, which is a single post. It's got a user, it's got the post itself of course, a list of reactions, the users who reacted to the post, a summary of the comments, and a visible reply labeled the most relevant comment. What we're going to do here is take a closer look at those reactions and the comments on this post. Here we see three values that appear to be summarized or calculated. First, we have the total number of comments on this post. Now you know that a post is going to have multiple comments and replies to it. You can already envision this document getting an update on every new post added with an…
Contents
-
-
-
-
(Locked)
Embedded documents as subdocuments3m 56s
-
(Locked)
Summary and partial documents6m 7s
-
(Locked)
One-to-one relationships6m 45s
-
(Locked)
One-to-many relationships with embedded documents7m 43s
-
(Locked)
One-to-many relationships with back references4m 3s
-
(Locked)
Many-to-many relationships5m 17s
-
(Locked)
Challenge: Create the proper relationships and summary documents for an online store1m 33s
-
(Locked)
Solution5m 52s
-
(Locked)
-
-