I have a real time firebase database that stores a list of users and it's stored in the following format(Json)
{
"users" : {
"-L29HeOZCmYu9UGJLMQR" : {
"name" : "John Doe",
"phoneNumber" : "+555-1566",
"points" : 21,
"rank" : 10,
"userId" : "-L29HeOZCmYu9UGJLMQR"
},
"-L2ASCuStoH7CTaqgBgG" : {
"name" : "Jenna Rose",
"phoneNumber" : "+555-3562",
"points" : 96,
"rank" : 0,
"userId" : "-L2ASCuStoH7CTaqgBgG"
},
....// A lot more users.
}
So my question is, how do I get the rank of the user in terms of the "points" variable? Also, how do I prepare a list of the top 10 or the top 100 etc..?