From the course: Data Modeling in MongoDB
Unlock the full course today
Join today to access over 23,400 courses taught by industry experts.
One-to-many relationships with embedded documents - MongoDB Tutorial
From the course: Data Modeling in MongoDB
One-to-many relationships with embedded documents
- [Instructor] We know that complex relationships are a reality when modeling data for a large application. In this lesson, we'll go beyond simple one-to-one connections and look into a more common use case, one-to-many relationships. We've been highly focused to this point on modeling out a single post, but we really need to consider a full social media page as an array of posts. But what are our use case for delivering a list of posts to the application? Our application has two main use cases to consider. First, all posts written by a given user, for example, your homepage. And second, all posts a given user should see, for example, your feed, which has the most recent post from all the people you know. This is going to require that we zoom out a little bit more and make some decisions on how best to retrieve this information. Again, think about your process. When modeling for Mongo, we should be working…
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)
-
-