Basically I'm having an issue with the amount of reads that I get from using the following code:
public Iterable<Contract> findAllExpired(){
List<Contract> empList = new ArrayList<Contract>();
CollectionReference collaborator = fb.getFirestore().collection("Contracts");
ApiFuture<QuerySnapshot> querySnapshot = collaborator.get();
try {
for (DocumentSnapshot doc : querySnapshot.get().getDocuments()) {
Contract emp = doc.toObject(Contract.class);
if (emp.isExpired()) {
empList.add(emp);
}
}
} catch (Exception e) {
// TODO Auto-generated catch block
}
Currently, I have 30 documents in my DB, is there a way in which I can retrieve those documents without causing the Firestore to count the query as 30 reads but as only one?