Firebase cloud function idempotency in docs
问题 I'm following the docs for Firestore here on Aggregation Queries. I couldn't help but notice that the cloud function solution wouldn't exactly work since it's not idempotent: numRatings is incremented and avgRating recomputed each time. Though this example could be made idempotent if there was also a separate document being stored for each new rating: you'd add a check if the user has already submitted a rating for the restaurant. Is there something I'm missing that makes this example