I want to make pagination with data what is stored in cloud Firestore
. It looks like that:
Note, It is different from load more or infinite loading. Lets assume that, When user click at pager 3, I need to make a request to my Firestore
to get 25 items from position 50 to 75(25 items per page).
I should do like that:
db.collection("cities")
.orderBy("population")
.startAfter(lastVisible)
.limit(25);
The problem here is I do not have lastVisible
. I know we can get lastVisible
by getting first 50 items but it is so dumb because if I do like that, why don't
I just get first 75 items and filter what we want in client.
The question is: How to get a number of items from an index to other index by query in Firestore
?
Any help would be appreciated! Thanks so much!