Skip to content

TypeScript code snippet – 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)
See also  Python code snippet - How to fit the whole text beside checkbox in ipywidgets?

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.