I am storing data in Firebase storage.
Object Comment with attribute timestamp. When I push data from device to Firebase I\'m populating
add a column namely timestamp with values (-1*System.currentTimeMillis())
and while fetching data use orderByChild("timestamp").limitToFirst(15)
or orderByChild("timestamp").limitToLast(15) according to your requirement.
it is smartway to get data in sorted manner, as firebase has no rule for descending order.