Count with Firestore Cloud Functions
问题 I like to count the number of documents in a subcollection with firestore cloud functions. My database looks like that: groups/{groupId}/members/{memberId} I like to count the number of members (memberId) for each group. That means every group can have a different amount of members, and they can increase or decrease flexible. Would be happy about your ideas :-). 回答1: Took me a while to get this working, so thought I'd share it for others to use: 'use strict'; const functions = require(