I'm trying to loop through all users (documents) in my user collection, and then access a collection in each user, where I will check if a field is set to true.
I am capable of looping through my users as follows:
let users = await firebase
.firestore()
.collection("users")
.get()
return users.docs.map(item => item.data())
But I am incapable of reaching further and accessing the collection inside of each user document.
All examples for accessing subcollections I've seen online have involved explicitly doing so, i.e.
let snapshot = await firebase
.firestore()
.collection('users')
.doc('exampleUID')
.collection('subcollection')
.get()
But I see no examples for guidance for getting collections for all documents inside a collection.