in references, how does costumer know that id put in the purchases list is from the product collection? or does that id need to be unique from across all collections in the database?
@snehaljagtap Жыл бұрын
Thanks for the swift explanation.
@noormuhammad88811 ай бұрын
Question: What if the quantity of a purchased product is more than one. How can the reference way of creating document handles such case?
@user4678-c9x11 ай бұрын
Probably by storing an object in the array instead of just an id. For example { “quantity”: 4, “itemid”,”19768hdi65”}
@user4678-c9x11 ай бұрын
Or even better turn the array into an object and do products: { “itemid”: { itemid: “itemid”, quantity:4}}. Then you can refer to user.products[itemid].Quantity to get quantity and and that.itemid to get the id
@salmanmohammad4706 Жыл бұрын
Great explanation ❤🔥😊
@augustocastro376 Жыл бұрын
Amazing video
@archuser532 Жыл бұрын
nicely explained
@samyamtimsina2 жыл бұрын
thanks
@MicheleHjorleifsson9 ай бұрын
That is bad design, you never want that reference to be potentially infinite. Better to have an orders collection that contains the Customer identifier and the list of products under an order id