Search code examples
angularfirebasegoogle-cloud-firestorefirebase-cli

Unable to import Firebase Firestore getCountFromServer in Angular "firebase": "^9.8.3",


Im trying to get the total count of documents in a subcollection within the Firestore using the "Count documents with aggregation queries" base of the Firebase documentation Count documents with aggregation queries in an Angular application.

I've tried importing from @angular/fire/firestore and firebse/firestore.

But prompt error: "has no exported member named 'getCountFromServer'. Did you mean 'getDocFromServer'?"

enter image description here


Solution

  • 'getCountFromServer' was introduced in the firebase version 9.11.

    You have to install either 9.11 or install the latest to get all the features.