Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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)
Source by fireship.io #
 
PREVIOUS NEXT
Tagged: #order #documents #firestore
ADD COMMENT
Topic
Name
9+8 =