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?