Firestore查询子集合 [英] Firestore query subcollections
问题描述
$ ul
- danceName
- 歌曲[集合]
- 歌曲名称
<
- 歌曲名称
如何查询Find all dances where songName =='X'
这是一个尚不存在的功能。这就是所谓的收集组查询,可以让你查询所有的歌曲,而不管哪个舞蹈包含它们。这是我们打算支持,但没有一个具体的时间表什么时候到来。
在这一点上的替代结构是使歌曲顶级集合并使其跳舞的歌曲是该歌曲属性的一部分。
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.
这篇关于Firestore查询子集合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!