Many-to-Many Relationship Documentation

Hello,
Sorry for my question may be to much detailed but I can’t find more details event on the mongo documentation.
I tried to read but not sure how to understand relationships .
Here is how I understand

  • users.shipping_address.street and items.reviews.body
    ==> users.shipping_address.street has a OneToOne with users and items.reviews.body has a ManyToOne with user ?
  • users.credit_cards.number and items.reviews.body
    ==> this one is obvious I think.
  • items.title and items.reviews.body :
    ==> item.title has a OneToOne with Items and items.reviews.body has a ManyToOne with users ?
  • stores.address.street and items.description
    ==> stores.address.street is a OneToOne with stores and items.description is a OneToOne with items, but Store and Items have a M2M relationship it’s really confusing.
  • items.sold_at and items.reviews.body
    ==> as items and store are M2M so the condition is a M2M ? Or, item.sold_at is a M2M and items.reviews.body is a ManyToOne with users.
    Sorry again if I wrote to much things but I can’t find explanations on how to read this, may be I didn’t understand all the video (English is not my native language).
    Thanks for your help.

Hi @Wisevolk see if this thread helps:

Thanks @007_jb I already read this thread, but it didn’t help, unfortunately it doesn’t help me but anyway I will test a last try and I hope the detailed answer will be well explained ;).

Two tips regarding some of the things you wrote in your first post:

When you are looking at direct relationships like this, ignore the underlying relationship between the collections. Think about the direct relationship between the fields. In other words, this isn’t a M2M relationship. Secondly, when you see an array, this side is a Many.

Hope you pass! :grinning:

1 Like

Thanks, I’ll try to apply your explanation, it sound clear but not obvious :wink:

IMO the lecture was not preparing the viewer enough to indeed pass the according M2M lab. The examples in the lecture were pretty clear to me (probably because there were only two collections being related to each other and it was easy to get the logic) but I felt totally lost with the lab. Why didn’t the lecture at least brought up one example similar to the lab (3 nested collections)?

I had no clue how to the deeply nested fields relate to each other and even reading all those answers in this and the linked thread did not really help my comprehension.

2 Likes