I'm storing a score for each player of my game in firebase.
scores {
name,
score
}
I want to sort the scores by highest to lowest.
This is what I'm trying
let highestScore = firebase.database().ref('scores').orderByChild('/score');
highestScore.on('value', getData, (err) => console.log(err));
This is how the database is setup
How can I sort the scores by highest to lowest?
Thank you.
Edit:
This post got be banned from asking questions :( what can I change from it?