In a component I want to pull a range of items from FireStore, for ex. from 0 to 5, from 5 to 10 etc. I found this in FireStore\'s docs, but they dont use AngularFire2 so as
I don't know about FireBase, but I'am awesome when you ask about all the items and then filtered.
If you make a method that has as arguments, page and size and an array lastScore I supouse that you can make some like (NOTE: I have NOT Firestone and, the most probably, I'm wrong and the code is bad)
//In service
lastScores:number[]=[];
lastPage:number=0; //use to know where you reach the last page
getNextHightScores(page:number,count:number)
{
//get the limit
let last=page>0?lastScores[page-1]:999999999 //if page=0 a bigger score
//use where and limit
return afs.collection- ('scores', r =>
r.where("score", "<", last).orderBy("score","desc").limit(count)
.valueChanges()
.do(r=>{ //using do to store the lastScore
if (r.length)
this.lastScore[page]=r[r.length-1].score;
if (r.length
{console.log(r)})
}
//and