I have the following structure in database.
"globalContestID": {
"1181855391902492":
{
points: 123456789
timestamp: 123456789
},
"123456742234324":
{
points: 1323344234
timestamp: 122441434
} }
I'm trying to get top 10 scores in past week or month etc. I need to get the data between start time and end time and then sort based on points to get top 10.
This returns NULL:
mContestTableName.orderByChild("timestamp")
.startAt(starttime).endAt(endtime)
.orderByChild("points")
.limitToLast(10) { }
If I remove the "points" part, the query returns all data, So data is fine.
What am I doing wrong in the query?