I have a question about firestore and cloud function.
let say i have 2 collection: products and reuse_shopping_carts.
and my reuse_shopping_cart document contain many products with all it’s properties (id,name,price,href).
now i want that if i change the price of a specific product in products collection , a cloud function will run on all reuse_shopping_cart documents and in every document that contains the specific product it will change is price.
someone can explain me how? or what is the right approach to do it?
i know i can store in the reuse_shopping_cart only the product id and fetch the updated product data at client, but for a list of 100 product in one reuse_shopping_cart it’s will require 100 separate query for every time i want to read the shopping list, and changing price of a product is mach more rare, so i think it’s a better approach.
if you think differently i will happy to hear... thank you!