I am currently working on a project that requires angular as a front end and firebase as a backend. However, when I was querying for a doc, I can't do something in a snapshot but can't seem to return anything.
this.afs.doc(`meals/${meal.id}`).collection('pending', ref => ref.where('uid', '==', this.authService.getUserID())).valueChanges().pipe(take(1)).subscribe(matchingRecs => {
if(matchingRecs.length > 0) {
return true;
}
else return false
})
I have this at the moment and it returns underfined but i know its true because the console log prints true