Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

how to sort documents in firebase database date wise

// Create Data
const timestamp = firebase.firestore.FieldValue.serverTimestamp;

db.collection('things').add({ ...myData, createdAt: timestamp() })


// Query
db.collection('things').orderBy('createdAt').startAfter(today)
 
PREVIOUS NEXT
Tagged: #sort #documents #firebase #database #date #wise
ADD COMMENT
Topic
Name
1+1 =