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'"
UPDATE Now Firestore supports array-contains
Having these documents
do it this way
@Nelson.b.austin Since firestore does not have that yet, I suggest you to have a flat structure, meaning:
Having it in that way, you can get it done:
I hope this helps.
It could be better to use a flat data structure.
The docs specify the pros and cons of different data structures on this page.
Specifically about the limitations of structures with sub-collections:
Contrasted with the purported advantages of a flat data structure: