I thought I read that you can query subcollections with the new Firebase Firestore, but I don’t see any examples. For example I have my Firestore setup in the following way:
Dances [collection]
– danceName
– Songs [collection]
---- songName
How would I be able to query “Find all dances where songName == ‘X’” in Ionic with Firestore ?
I am trying to do a where query and its still not working.
I have a service provider where I want all the documents where the userUid matches
getUserDishes(uId): AngularFirestoreCollection<Dish[]> {
console.log("ishaan: Calling user dishes with userUid: "+ uId);
return this.firestore.collection('dishes', ref => ref.where("userUid", "==", uId));
}
And in my .ts file
ngOnInit() {
this.userDishList = this.firestoreService.getUserDishes(this.auth.getUserUid()).valueChanges();
//this.userDishList = this.firestoreService.getDishesList().valueChanges();
console.log(this.userDishList);
}
Not sure why this is not working