I have a collection model that looks like this :
How do I sort the query from latest to oldest via the createdAt
field.
So far I tried
db.ref('accounts')
.startAt()
.orderByChild('createdAt')
.once('value')
.then(function(snap){
// do shits here...
})
But am getting the data the oldest on top.
- January
- February
- March
But I want
- March
- February
- January