I'm searching a subquery in Firebase and I'm trying to find the parent collection (and then the parent document) it is a part of. Here is my code
let queryRef = orgRef.where('User_ID', '==', userID).get()
.then(snapshot => {
if (snapshot.empty) {
console.log('No matching documents.');
return;
}
snapshot.forEach(doc => {
console.log(doc.parent());
});
})
.catch(err => {
console.log('Error getting documents', err);
});
however using doc.parent, or snapshot.parent doesn't work. How do I find the parent documents of the subcollection?