I am trying to query my firebase database in a way that will get me a query which I will be able use in the FirebaseRecyclerAdapter. The structure is the following:
root
--USERS
---Favorites
----{Some post IDs}
So after I get these IDs and save them in a list
I want to show them in a recyclerView with all the post details. In order to do that I need to access an other portion of my DB which is the following:
root
--POSTS
---{POST_IDS}
----{POST_DETAILS}
Now lets say that the list of the favorites posts of user contains the following IDs [1,3,8].
val query: Query = housesDb.orderByKey().startAt(favPostList[0]).endAt(favPostList[favPostList.size - 1])
The problem with this query is that I also get the inbetween IDs like [2,4,5,6,7].
Is there any way to query like:
val query: Query = housesDb.orderByKey().equalTo(favPostList)
A simple solution would be to create a custom adapter but I would prefer to use the Firebase one if possible.