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

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