Firebase realtime database get Online Friends

Viewed 350

I am not sure if this is possible in fire base as I wish, My database is

    User_ID: ID
        online:true/false
        friends: 
               ID: Name 
               ID: Name 

User login in, retrieve his information including friends Ids.

My question can I get All users with some IDs (User friend Ids) who have online true.

Looks like 2 queries: (Where friends ids(multiple ids) = ??? and online = true)

I have workaround solution for this but I don't like it As i have to get all Online users (friends and none friends) and keep only friend, in this case I will retrieve data which I dont want in this case.

1 Answers
Related