M320 chapter 2: Many- to -Many Relationship

Hi, a data modeling expert has the definition of each entity. What pieces of info. the “sold_at” entity and the reviews and the “body” entity holds? Is a review the user’s idea
about the item. Is the entity “body” user’s opinion about an Item". I have no idea what
pieces of info. the entity “sold_at” holds? I only know it’s type is integer.
please help me to make these issues clear.

Hey @farideh_gorji,

items.sold_at is an array. sold_at[0,200] means it is an array that says that a given item can be sold at 0 to Many stores. If you notice the [0,200], it means the item can be sold at 0 stores and the value of many here is kept 200 since we have 200 stores, hence that is the maximum.

The values this array will store will be of type int. It will contain the id of the stores that are selling this item.

reviews.body is a string that contains the review of that item for that particular user_name.

Let me know if there are still any doubts about this. I would recommend you to re-watch the lectures before the lab and go through the course pre-requisites as well if there is any confusion. Feel free to reach out for anything else as well.



Are you explaining the stores[200] _id: in the second part of your reply?
Is stores[200] _id an array which will contain the id of the stores?

Hey @farideh_gorji,

No, I was talking about items.sold_at. It is an array and its explanation was being provided by me in my previous reply.

_id is the primary key for every document, it is not an array. You can read more about it from the documentation: Document Structure

Let us know if there’s still anything that is not clear.


1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.