0

It seems to me that querying data in Firebase is quite troublesome.

I wanted to do something like "select items where item's id IN (value1, value2)".

Is there any simple way that doesn't need to make multiple queries?

Thịnh Phạm
  • 2,528
  • 5
  • 26
  • 39
  • Firebase querying can filter the data for a single value on a single property only. In some cases you will be able to combine your values into a single property and filter on that. In other cases, you can set up a custom index, where you have `value1` and `value2` as keys and the IDs of the items with that value as children. But all of these will require multiple lookups. – Frank van Puffelen Nov 21 '15 at 14:53
  • Possible duplicate of [Query on multiple values in Firebase, similar to IN() SQL functionality](http://stackoverflow.com/questions/30132451/query-on-multiple-values-in-firebase-similar-to-in-sql-functionality) – Frank van Puffelen Nov 21 '15 at 14:54
  • Firebase queries are easy. However, they are not SQL queries so you need to structure your data in a NoSQL way to retrieve the data you need. Can you post an example data structure and maybe we can provide some direction. – Jay Nov 21 '15 at 14:55

0 Answers0