First of all, I already saw : this answer, and other answers.They don't responde to my question.
I haee a pretty long list of events:
{
"event1": {
"date" : 1420753443,
"name" : "name1"
},
"event2": {
"date" : 1429053443,
"name" : "name2"
}
}
I need (if possible) to get the events between two indexes (not dates), but ordered by date.
For example, I tried to intersect two lists in order to accomplish my goal:
let query = this.databaseRef
.orderByChild('date')
.limitToFirst(100)
.limitToLast(100);
but an error is thrown
Also, some events can be at the same time. Because of that, I can't use the last date on the previous page to query the events for the next page
let query = this.databaseRef
.orderByChild('date')
.startAt(oldDate)
.limitToFirst(10);
My purpose is to get from firebase as much items as needed to be sown on user's screen: first the items in range 0-9, second 10-19 etc..
skip()method for queries. So you might need to execute more than one queries. For example, you might need to get the sixth record first and then tenth record and usestartAtandendAttogether to get the records between them. But this would be a really bad thing for performance. For a different idea maybe you can store the record order and query with that value - bennygenel