sort descending in firebase Query code example
Example 1: firebase order by key descending
firebase.database().ref('books').orderByChild('ups').limitToLast(2)
Example 2: order documents in firestore
// Create Data
const timestamp = firebase.firestore.FieldValue.serverTimestamp;
db.collection('things').add({ ...myData, createdAt: timestamp() })
// Query
db.collection('things').orderBy('createdAt').startAfter(today)