I believe for you to try and read about firebase query method, you probably have an idea of what firebase does.
But if not just know that firebase database is a NoSQL json databases which is a fancy way of saying its just json object :).
read more - Firebase
The first query method that you need, always, is an orderBy.
Next, you need to decide how many records you want and which direction you want to order.
ascending order, because Firebase only sorts in ascending order. So if I have records 1…10 and I run a limitToLast(3), I’d get records 8, 9 and 10 in that order.
Finally, decide which key you’d like to start or end at.
There is still alot of things that still need to come to play before having a successful firebase query