0

I am building a GPS tracking web app and I have structured my data in Firebase database as root Node is GPSLocationHistory

{
"-KkUgBL6Zs761WWJ8RC_" : {
"Battery" : 1,
"createdat" : 1,
"hajjappnum" : 1,
"id" : 1,
"lati" : 31.321846666666666,
"longi" : 74.22081833333333,
"uniqueID" : 6430041994
},
"-KkUiQQSox-smGjx0Oq2" : {
"Battery" : 1,
"createdat" : 1,
"hajjappnum" : 1,
"id" : 1,
"lati" : 31.321846666666666,
"longi" : 74.22081833333333,
"uniqueID" : 6430041994
},
"-KkUkHe-nNfAvyFHGDBu" : {
"Battery" : 1,
"createdat" : 51920176786,
"hajjappnum" : 1,
"id" : 1,
"lati" : 0,
"longi" : 0,
"uniqueID" : 0
 }
}

I want to retrieve all the objects with latest "createdat" value for all different "uniqueID" values but it's mentioned in documentation we cannot use multiple order by calls so how do I retrieve this particular query to work any idea?

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Mehroz Irshad
  • 287
  • 1
  • 5
  • 14
  • It may be possible to combine the values you want to filter on in a single property. See http://stackoverflow.com/questions/26700924/query-based-on-multiple-where-clauses-in-firebase – Frank van Puffelen May 19 '17 at 14:15
  • If you show me the sql version of what you mean I will definitely provide you an answer – Emeka Obianom Jun 26 '17 at 20:33

0 Answers0