Chapter2 - One to Many Relation Ship

In the video(1:12): OneToMany Representations, please provide examples of Embed and Reference.

Welcome. Hopefully the course authors will consider your request, but as for me,
I think that “Embedding” means that data from a document in one collection is duplicated in another document/collection either as a field, fields or a sub-document. In the following schema diagram, an array of documents from the reviews collection has been duplicated in the items collection:

“referencing” is when the key field from a document in one collection is duplicated in another, providing a means for the data to be retrieved as and when required. In the following schema diagram, the “zip” field in the stores collection is a duplicate of the _id reference field in the zips collection:
image

I wrote and used these Quizlet study notes for learning and revision: https://quizlet.com/549614688/learn

1 Like

Hi @Siva_Rama_Krishna_Gunthoti,

@Neil_01783 has done a wonderful job explaining the concept. If you still need additional references, here are some documentation links :slight_smile:

Kanika