From the course: Learning MongoDB
Unlock the full course today
Join today to access over 24,100 courses taught by industry experts.
What can you store in a document? - MongoDB Tutorial
From the course: Learning MongoDB
What can you store in a document?
- [Instructor] MongoDB documents could store a wide variety of data in a number of different formats which often makes development easier. So far, we've mostly worked with text or number fields in our documents. These are much like the basic types you might be used to in a relational database but what if we want more flexibility? Take this recipe for example. When we think about it, recipe contains a lot more than just text or number data. In fact, it has a lot more structure and detail that we can see on the printed page and categorize in our minds. But how do we store it? Sure, we could just copy and paste list of ingredients and the directions and store them in a large text field, but then we'd lose a lot of granularity and options for what we could do with that data later. For example, what if we need to change the measurements from imperial to metric? or change serving sizes? In a traditional database, at this…