여기서 도전은 Firebase에서 'and'쿼리를 수행하는 것입니다. 존재하지 않습니다. 따라서 두 개의 데이터를 함께 사용하여 쿼리를 수행해야합니다. 아티스트와 트랙 이름을 알고있는 경우 여기, 구조이 구조로
artists
artist_0: Pink Floyd
artist_1: Billy Thorpe
artist_2: Led Zeppelin
tracks
track_id_0: Stairway To Heaven
track_id_1: Children Of The Sun
track_id_2: Comfortably Numb
artists_tracks
artist_0_track_id_2: true
artist_1_track_id_1: true
artist_2_track_id_0: true
posts
post_id_0
artist_track: artist_1_track_id_1
post: Billy was one of the most creative musicians of modern times.
post_id_1
artist_track: artist_0_track_id_2
post: The Floyd is the best band evah.
을, 당신은 그들을 연결하고 존재하는지 (참) .equalToValue에 대한 artists_tracks 노드에서 간단한 쿼리를 할 수 있습니다.
게시물 노드의 게시물은 특정 아티스트 및 트랙과 연결됩니다. 이 때문에 이름에 공백과 텍스트의 다양한 폭, 그러나이
stuff
artist_track: Billy_Thorpe_Children_Of_The_Sun
처럼 ... 추가 노드없이 수행하고 검색하기 위해 함께 데이터를 접착제 수있는 경우에
그 작동하지 않습니다. 따라서 길이가 일관되게 유지되도록 많은 노래 및 아티스트를 처리 할 수 있도록 데이터에 충분한 자릿수가 포함되도록해야합니다.
artists_tracks
artist_00000_track_id_00002: true
이제 50,000 명의 아티스트와 50,000 개의 트랙을 가질 수 있습니다.
출처
2016-06-14 21:20:52
Jay
자세한 답변을 보내 주셔서 감사합니다. (그리고 kickass tracks;)) – Gil