above is a screenshot of my firebase database. i am trying to sort firebase data in descending order using negative timestamp. I 'm using the following command:
const feedRef = database.ref('ducks')
feedRef.orderByChild('timestamp').on('value', (snapshot, error) => {
const feed = snapshot.val()})
i keep getting the feed in the same order as the database not in the descending order like i want.I think its not working because ducks endpoint doesnt have a child name timestamp
how would i achieve this? Do the push generated keys have timestamp data ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…