This is the code that I have: I am trying to get data stored in the Firebase Database sorted by wage. The order of the database goes: "Posts -> PostID(.push when saving) -> Wage." I have the data retrieval working just not in order.
var PostsRef = firebase.database().ref().child("Posts");
PostsRef.on('child_added', function(data) {
var title = data.val().title;
var description = data.val().description;
var completionDate = data.val().completionDate;
var complexity = data.val().complexity;
var wage = data.val().wage;
var uid = data.val().userID;
});