Let's say I have the following posts in my database:
posts: {
-sdmi8dfnsj0sdk: {
text: "some text",
category: "General",
date: 123283493479 <-- Timestamp
},
-Udj48sjdkfa20l: {
text: "another text",
category: "Movies",
date: 139474004949
}
}
So my problem is, I want to fetch the posts wherein their category is equal to General but at the same time fetch them in chronological order (Newest to Oldest). Any ideas how to do this?
I'm aware that using orderByChild("category").equalTo("General") would work on filtering the data to be fetched but how about fetching them chronologically (Newest to Oldest) while at the same time being able to paginate the data for the next fetch?