0

I'm having a Firebase database structure like following.

enter image description here

I need to write a Firebase query to retrieve "my_songs" if my search text contains in "artists" array.

Arvin Jayanake
  • 1,475
  • 3
  • 14
  • 26
  • Please avoid arrays in Firebase. See my answer to [this question](http://stackoverflow.com/questions/37435638/adding-items-to-firebase-array-in-swift-without-observing-for-array-first/37437346#37437346) as well as [another question](http://stackoverflow.com/questions/38369382/saving-array-in-firebase/38421497#38421497). Oh and [yet another answer](http://stackoverflow.com/questions/42164608/nested-information-in-firebase/42166245#42166245). As you can see there is a lot of great information here - it just requires some research. – Jay Mar 19 '17 at 12:44
  • @Jay You are right. I contacted the Firebase support about this matter. As they say for now, they do not have a direct support for a "contains" or "like" function in the Firebase query. Solution is change my data structure. [Denormalization](https://firebase.googleblog.com/2013/04/denormalizing-your-data-is-normal.html) of data to avoid creating complex queries and to make the process as easy as possible. – Arvin Jayanake Mar 20 '17 at 14:24

0 Answers0