I'd like to create an application that includes something like an rss feed or a feed that you might see instagram or facebook. I'm currently trying to accomplish this using the firebase real time database or firestore as a backend to store the posts shown to the users. I can't seem to think of a way to make this work. The ideal solution sends a list of posts in chronological order that doesn't need any additional sorting on the client. When I tried to use the real time database, I could easily add all the relevant posts in their own path and sort them on the client side (or maybe use cloud functions to sort the data on the server side). When trying to come up with the solution using firestore, my idea was to have the post document hold a reference to a sub collection that holds the list of subscribers/followers but I can't seem to find a way to select a post based on whether a document exists in a referenced sub collection.
FYI, the reason why I want the ideal solution is because PAGINATION.