Get top numbers firebase

Plz
How I get Top values and minimum from this


Thanks

If there are child nodes for Survey, create the variable Max = -1 and loop through all the child nodes of Survey. If the current node value is greater than Max, assign it to Max.