I have a Firebase Realtime Database with a very simple structure as follows:
users
$username
added: timestamp
gender: m or f
What I want to do is to load the users into the browser, filtered by gender and sorted by timestamps. I filter the gender like so:
firebase.database().ref('/users/').orderByChild('gender').equalTo('m').once('value', ...)
but the data is still sorted lexicographically by the $username. How can I change the order? Is there a rule to change serverside sorting from the key of $username to sorting by a childs value?