I'm using pagination to reduce the number of calls with Firestore, I managed to set it up correctly.
But I also need to get the total number of all the documents upfront corresponding to the query which looks something like this:
let query = db.collection("Posts").document(uid).collection("Posts").order(by: "timestamp", descending: true)
If I need to get the total number of documents upfront what's the point in paginating? Is there a point to it?
To be clear I only need the number of documents and not to read them all at the beginning.