In my collection's SnapshotListener, I have am looping through the documents with:
for (DocumentChange doc : queryDocumentSnapshots.getDocumentChanges()) {
if (doc.getType() == DocumentChange.Type.ADDED) {
String somestr = doc.getDocument.getString("someField");
// retrieve collection here
}
}
And within each document in the for loop, let's call it doc
, I have another collection of documents on Cloud Firestore. I would like to retrieve all documents (each of which just has a single String field) within the subcollection inside doc
. I'm able to do a doc.getDocument
to get doc
itself, which I am using to get a string field, but I don't know how to get the documents in its subcollection.