Databases · Middle · Question 48 of 75
In MongoDB, when should related data be embedded in one document rather than referenced?
- 1Always, because joins are impossible
- 2Never, embedding is deprecated
- ✓Correct answer: When it's read together, belongs to the parent and stays bounded in size, like order items in an order
Explanation
Reference data that grows without limit (all comments of a popular post) or is shared by many documents. MongoDB documents are limited to 16 MB.