0

Here is the json structure I am using:

|-a
  |--date1
     |--uid1
     |--uid2
  |--date2
     |--uid3
  |--date3
     |--uid1

I need to get uid1 for all dates. How ,to query for the same using firebase .

aofdev
  • 1,772
  • 1
  • 15
  • 29
Manas Saxena
  • 2,171
  • 6
  • 39
  • 58
  • Possible duplicate of [How to retrieve data from Firebase Database?](https://stackoverflow.com/questions/38541098/how-to-retrieve-data-from-firebase-database) – gegobyte Sep 09 '17 at 13:38
  • Is uid1 a key or value within each date node? If it's a value, what is it's key? – Jay Sep 09 '17 at 16:59

1 Answers1

0

One way would be to duplicate your data structure like:

|-a
  |--date1
    |--uid1
    |--uid2
  |--date2
    |--uid3
  |--date3
    |--uid1
|-a-uid1
  |--date1
  |--date3

This kind of duplication is quite common for NoSQL databases and it will provide you the best performance (query response time)

Renaud Tarnec
  • 79,263
  • 10
  • 95
  • 121