I am encountering some challenges with nested queries:
firebase.database().ref().child('panels').child('qa')
.orderByChild('completed')
.startAt(firstDay.getTime()) // January 1st, 2016
.endAt(lastDay.getTime()) // current date (aug, 25th 2016)
.once('value', function(snapshot) {
$log.log(snapshot.numChildren());
});
It returns 0
However, when I move 'completed' to the first level of the node, it works as expected:
firebase.database().ref().child('panels')
.orderByChild('completed')
.startAt(firstDay.getTime()) // January 1st, 2016
.endAt(lastDay.getTime()) // current date (aug, 25th 2016)
.once('value', function(snapshot) {
$log.log(snapshot.numChildren());
});
This time it returns 10;
Can anyone shed light on why the nested approach is not functioning correctly?