Firebase Data Desc Sorting in Android

前端 未结 15 2474
醉话见心
醉话见心 2020-11-22 07:51

I am storing data in Firebase storage.

Object Comment with attribute timestamp. When I push data from device to Firebase I\'m populating

15条回答
  •  甜味超标
    2020-11-22 08:08

    If you are doing it on web then you can push values in an array and then print the stored values in reverse order.

    var a=[]; //declaring an array a.
    var num=snapshot.numChildren(); //storing number of children in var num.
    a.push(snapshot.val()); // pushing data in the array.
    if (a.length==num){ //checking if length of array is same as number of children.
    a.reverse(); //reversing the array elements.
    for(i=0; i

提交回复
热议问题