From the course: Data Modeling in MongoDB

Unlock the full course today

Join today to access over 23,400 courses taught by industry experts.

Solution

Solution

(upbeat music) - [Instructor] Okay, let's see how we did on this final challenge. First, we'll take a look at the visual, the ERD for this. Now, here we have an example solution of an ERD from our data model where we have the customer with some basic information but the big items here are the array of addresses and the addresses you'll see use a sub document defined as an address document. The wish list has an array of objects, which are defined as product objects or product sub document. And the cart has an array of cart items which again are products. So we've used sub documents to model the way that our bigger models look. And I think the visual of this really sort of seals the way that those things actually come together. The orders collection of course, has a back reference back to the customer to make that look up a lot easier. And the products documents, or the products collection given a product ID and the…

Contents