From the course: Data Modeling in MongoDB
Unlock the full course today
Join today to access over 25,200 courses taught by industry experts.
Embedded documents as subdocuments - MongoDB Tutorial
From the course: Data Modeling in MongoDB
Embedded documents as subdocuments
- [Instructor] In this lesson, we'll be taking a look into subdocuments or embedded data. Now to this point, we've been talking a lot about our documents being expressive or having depth to them. That depth comes to us sometimes just as a matter of how we describe things, but often, those things have semantics about them or some predictable structure. And this is where we get into defining the smaller parts of our models with subdocument modeling. Before we dig in, let's remind ourselves again of the target that we're diving into, which is a single post. Now the post has a user. It's got the post itself, along with the list of all the reactions, a summary about the users that reacted to it, and a visible reply labeled the most relevant content. Let's dig in a little deeper and see if we can find patterns within a post. Looking deeper at a post, we can see that we have two users being shown on screen. Likely, if there…
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)
-
-