My Firebase structure is like follows:
Posts
- post1
- timestamp
- groupID
- text
- post2
- timestamp
- groupID
- text
Users
- user1
- groups
- group1
- group2
- some other data ...
- user2
- groups
- group1
- group3
- some other data ...
I want to implement a "news feed" (kind of like Facebook has), in which all posts from all groups a specific user is a member of, are shown. So, in my example I'll first read the groups the user is a member of (e.g. "group1" and "group3" for "user2". These keys correspond to "groupID" in the "Posts" node. I want to get all posts, where groupID == group1 OR groupID == group2 sorted by the timestamp. How am I to do this? I tried ordering the posts by groupID via the "equal"-query but this won't give me the possibility to sort by timestamp as Firebase does not support multiple query-ordering.