1 Answer
  • 0
name Punditsdkoslkdosdkoskdo

Firestore query subcollections

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'"

This is a feature which does not yet exist. It's called a "collection group query" and would allow you query all songs regardless of which dance contained them. This is something we intend to support but don't have a concrete timeline on when it's coming.

The alternative structure at this point is to make songs a top-level collection and make which dance the song is a part of a property of the song.

  • 0
Reply Report