I am using firebase realtime db and my query looks like below:
const doc = ref(this.db, "/users/" + uid + "/badges")
const qry = query(doc,orderByChild("time"))
onValue(qry, (snapshot)=> {
const val = snapshot.val()
console.log("load user badge val::::", val)
})
The output i am seeing is like below
-NC3EpHyAuDVorcfp0J7: {description: 'Here is your first badge', time: 1663297344697, title: 'Newcomer', url: 'https://xxx'}
Hi Five: {description: 'You solved five words', time: 1663298169153, title: 'Hi Five', url: 'https://yx'}
Sprout: {description: 'You solved your first word', time: 1663298169147, title: 'Sprout', url: 'https://lll'}
I am expecting the entries to be order by time property. but they are not. the value for "Hi Five" should be the last one rather the middle one.
What am i missing?