I'm using collection group query but I'm unable to get the parent document ID.
collection
document1
subC
doc1
document2
subC
doc2
On running a query I want to get the name of parent document, i.e. document1, document2, etc but it returns me doc1 and doc2. This is my query:
var col = FirebaseFirestore.instance.collectionGroup('subC').where('foo', isEqualTo: 'bar');
var snapshot = await col.get();
for (var doc in snapshot.docs) {
print(doc.id); // Prints doc1, doc2
}