0
Firebase에서 두 가지 별도의 쿼리를 수행하려고합니다. 첫 번째는 저장된 총 항목 수를 가져 오는 일반적인 쿼리입니다. 그건 제대로 작동합니다.Firebase 날짜 범위 쿼리가 작동하지 않습니다.
두 번째 것은 올해 기준으로 저장된 모든 항목을 결정하는 시간 기반 범위 쿼리입니다.
첫 번째 쿼리가 작동합니다. 두 번째는 콘솔에 "null"을 표시합니다. 모든 쿼리가 여기에 첫 번째 항목과 마지막 항목에서 타임 스탬프를 살펴 인 2016 년
var ref = new Firebase('https://xxxxxxxx.firebaseio.com/entries');
ref.once('value', function(snapshot) {
$scope.allEntries = snapshot.numChildren();
console.log('Total entries saved to date: ' + $scope.allEntries);
// shows 10 entries, which is correct
});
var ref2 = new Firebase('https://xxxxxx.firebaseio.com/');
ref2.child('entries')
.startAt(14516244) // January 1st, 2016
.endAt(1472131318) // current date (aug, 25th 2016)
.once('value', function(snapshot) {
console.log(snapshot.numChildren());
// shows "null"
});
에서 만든 그것은 또한 "10"를 표시해야합니다.
이제 "null"대신 "0"이 표시됩니다. "10"이어야합니다. – Livi17
문제가있는 곳을 안다. 나는 잠시 후에 대답을 편집 할 것이다. – pr0gramist