I want to iterate through a list of subcollections inside my top-level collection and retrieve their data one by one, without first knowing the names of said subcollections. The subcollections canbe created by users, so I won't know their names/IDs ahead of time.
I've seen a couple of answers on here about getting subcollections, but they all seem to be with hardcoded collection names. Example A Example B
When I pull and console log out my toplevel herbalTeas collection currently, I just see a piece of dummy data. What I'd like to see is all my other subcollections (which are currently mint and chamomile, but could grow dynamically) in my console as well, so I can iterate and do things with their data.
See screenshot below of by firestore structure.
I'm console logging that data via this code:
const collectionRef = await getDocs(collection(db, "herbalTeas"));
collectionRef.forEach((doc) => {
console.log(doc.data()); // logs out {test: "test}
});