I have this Firestore structure:
Collection: Users
Documents: one for each users
2 sub collection: "in corso" and "finite"
Documents: many documents for each sub-collection
I need a way to loop every User in collection and update/delete the documents in the two sub collection of each user.
I tried this approach: https://pastebin.com/nqsGuMm6
Giving me the following exception because of Firestore Quotas Limit:
Exception from a finished function: Error: 4 DEADLINE_EXCEEDED: Deadline exceed.
I'm trying to find a different approach. The only idea I came up with is calling another cloud function for each User and update his document with that other function. Not sure this is the best approach so I'm looking for other advices
Thank you