skip to Main Content

In this Cloud Firestore documentation, it seems like the sum() aggregation is only for the client side. Is there any way I can run the sum() aggregation inside cloud functions using the Admin SDK?

2

Answers


  1. Chosen as BEST ANSWER

    As @Frank van Puffelen mentioned, the sum() Node.js sample in the Firebase guide is not for Firebase Admin Node.js SDK but for the Google Cloud Node.js SDK. Therefore, the sum() aggregation is not available in the current Admin SDK version(11.11.0).


  2. Inside the official documentation regarding Firebase Admin SDK for Node.js, you’ll find an API for Firestore. Now, if you check the documentation related to the CollectionReference or Query, you’ll see that the count() function already exists but there is no sum() function present yet. I think it’s a matter of time until it will be added.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search