Firestore - how to get the total number of records in a collection like we are doing in sql [duplicate]
问题 This question already has answers here : Cloud Firestore collection count (17 answers) Closed 2 years ago . db.collection("cities").get().then(function(querySnapshot) { console.log(querySnapshot.size); }); but the problem is I am using pagination and load 30 records for each call. so I am unable to get the total numbers of records. Is there any way to get it ? like, we are doing in sql. 回答1: How to get the total number of records in a collection with Firebase ? The method numChildren() do