Im looking to use MongoDB for my database implementation. Why would you want to embded a document insode a document?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It is one way to do what in a relational database you would do with a JOIN (something that you cannot do in MongoDB).
For example, you could have a MongoDB document as a blog post, and embed the list of comments right in there.
Then you can (for example):
All that would be impossible (or at least difficult) if the comments were stored in their own collection as separate documents.