SITUATION:
I currently load the latest posts chronologically with this code:
CODE:
$scope.data = [];
var _n = Math.ceil(($(window).height() - 50) / (350)) + 1;
var _start = <%= lastID %>;
var firstElementsLoaded = false;
$scope.getDataset = function() {
fb.orderByChild('id').startAt(_start).limitToFirst(_n).on("child_added", function(dataSnapshot) {
_start = dataSnapshot.child("id").val() + 1;
console.log("LAST TRUE ID:"+ _start);
$scope.data.push(dataSnapshot.val());
$scope.$apply()
console.log("THE VALUE:"+$scope.data);
firstElementsLoaded = true;
});
};
$scope.getDataset();
QUESTION:
How should I modify it to essentially have the exact same behaviour but to only query posts with scores above 100 according to their chronological order ?
UPDATE:
I have finally found a way to use the "create another index" method with my architecture. But one hurdle remains: