how to get documents in firestore order according to a particular field code example
Example: 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)