From the course: MongoDB Essential Training

Unlock the full course today

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

Solution: Create a data model

Solution: Create a data model - MongoDB Tutorial

From the course: MongoDB Essential Training

Solution: Create a data model

(lively beats) - Alright, let's look at the solution for this. I want to, again, start this off by saying that this is a fairly vague specification. It's a good exercise to go through, but if your data model is different from what I'm going to suggest here, don't worry too much about it. The important thing is that you think about it. Alright, so the first thing that I see in this exercise is that it says it's an online store. With an online store, I would expect collections like inventory, orders, and users. Then, we move on to common queries. So, here, the first one is what's available with X features. Now, the first thing here I'm wondering about is, okay, if there is some sort of inventory collection, maybe I should have an index on the features that are available, if that's a common query for customers especially. The next thing that I'm being told is that there's going to be a common query on what's out of…

Contents