I am trying to create a conversation-room node for my users. I have the node that has from
and to
users' ids. Before creating a new room, I need to check both cases, where 'from' is host and to is opponent' & 'to' is host and 'from' is opponent.
The node looks like:
- Rooms
- "id1"
- from: 2
- to: 1
What I want to do is basically:
Select all from rooms where from = 1 and to = 2 OR from = 2 and to = 1
Is there a way to check both cases in a single query? I got confused understanding the nature of complex querying data with Firebase.