I'm building a social app using Firebase. I store posts in Firebase like this:
posts: {
"postid": {
author: "userid"
text: "",
date: "timestamp"
category: "categoryid"
likes: 23
}
}
Each post belong to a category and it's possible to like posts.
Now, I'm trying to show posts that belong to a specific category, sorted by the number of likes. It's possible I also want to limit the filter by date, to show only the most recent, most liked posts in a category. How can I do this?
Firebase query functionality doesn't seem to support multiple queries like this, which seems strange...