You must must use orderedByChild
by the key of the date you’d like to order the children by. You can then observe the Value
or ChildAdded
event type of this query to retrieve the children in ascending order of date. To have the most recent first, you must reverse the objects manually client-side. Otherwise, you could prepend a -
symbol to all the dates and handle it client side.
2
solved Firebase – How to order items?