What if we have an existing document in a MongoDB collection and we want to add a subdocument to document, or add a subdocument to a subdocument array within a document? We could explicitly create the collection with this design from the beginning, but depending on the related data that we have, this might not be immediately available. What about adding a subdocument to an existing document? We can do this and this allows for possible data change over time, as more "related" data are added, changed or removed for existing data. In this case, "existing data" would be our document while the related data to our existing data would be the subdocument.
In the video, we see that I take an existing document and add a subdocument to it. While the user originally asks, "Why not just use SQL since we'll have to use joins?" we actually see that we don't need to use joins. If the information relates to the document, we can store that relationship within the document in a subdocument. Outside of exceptional sizes, why not store related information in the document itself? Think of an example where we a collection of documents involving various homes for sale. We want one of the "relationships" to be the past sales' prices for each home. We could use the SQL design where we'd have relationships with tables being joined. But we could also store those prices as a subdocument for each document of a home for sale. There is some nuance about when we may consider this (see the below comment), but it is an option if we've chosen a NoSQL solution.
Design matters here. In some contexts, this would not be appropriate. An example of this might be if we had a ratings subdocument collection of a product or set of products. Depending on what we allow with the ratings, that may become significant in size and we may not want to maintain those subdocuments within the document itself. Some users might leave a rating as long as an epistle and that would become huge if we have enough users doing that. If we restrict ratings to only a rating (no comments), then this type of design may work within the document. The design ultimately matters because some solutions for the design may not be appropriate. As with everything, the more we allow, the more we'll take a hit in performance, scale and possibly security.
Source: MongoDB: Add Subdocument To Existing Document/Subdocument Array. Consider that we may want a design where all documents have subdocuments, only some have subdocuments, or none do. We do not need to explicitly create subdocuments, but can add them later if required.