Docs update: Querying sub collections examples
Hi Could you add some examples how to query sub collections. For example, we have profiles collection and likes sub collection. So query for profiles collection would be something like this:
let q = db.collection<Profile>('profiles', ref => ref.where('uid', '==', user.uid)).valueChanges(); q.subscribe(res => this.profile = res[0] ) ;
Profile doesn't have any refs to sub collection. If i'd use snapshotChanges() result the same.
You can't do that with SubCollections. Try db.collection(profile).document(user.uid).collection(likes) or define likes as an array if you want it to appear in valueChanges.
I don't see this as a special feature of angularfire2 so I don't think this should be included in docs.
@fellz did you solve it?
Not implemented yet in firestore. Have a look at this post. https://stackoverflow.com/questions/46573014/firestore-query-subcollections What you can do for now is to query your collection first, then get it's id and query for subcollections