This is the Firestore collection with custom document IDs which are actually dates as string. The purpose of this kind of custom id is fetching the documents of particular date.
Here's the code :
FirebaseFirestore.getInstance().collection("Users")
.document(FirebaseAuth.getInstance().getUid())
.collection("Bookings By Date")
.get().addOnCompleteListener(new
OnCompleteListener<QuerySnapshot>() {
@Override
public void onComplete(@NonNull Task<QuerySnapshot> task) {
if (task.isSuccessful()) {
Log.d(TAG, "onComplete: called");
Log.d(TAG, "onComplete: task result = " + task.getResult());
Log.d(TAG, "onComplete: task.getResult().getDocuments().size() = " + task.getResult().getDocuments().size());
QuerySnapshot queryDocumentSnapshots = task.getResult();
}
}
});
Here are Logcatlogs where task.getResult().getDocuments().size() is returning 0 it should return 3 as i have 3 documents in the collection.