Reputation: 45
I am trying to query my database to get all the dates which has child number > 7
this.extra = function() {
refer = ref.child(slot);
refer.orderByChild('number')
.startAt('7')
.once('value')
.then(function (snapshot) {
console.log(snapshot.key());
});
}
But am getting null results, any idea why?
Upvotes: 0
Views: 368
Reputation: 599001
You're passing in '7'
(with quotes) but have the value stored as 7
(without quotes). This means that you're comparing strings and numbers, which will not work.
Instead use this:
ref.child(slot)
.orderByChild('number')
.startAt(7)
...
Upvotes: 1