I'm new to firebase and databases in general so pardon me if it's something trivial. My collection looks like this:
Rooms{
Room1{
roomName,
user1,
user2,
},...
}
I wanted to filter the results so I can get only rooms that have user1 field different than id of the current user and user2 equal to an empty string.
I've read that there is no OR in firestore queries, you can't do it like this
const openRoomsQuery = roomsRef.where("user1", "!=", user.uid).where("user2", "==", "");
nor like this
const notMineRoomsQuery = roomsRef.where("user1", "!=", user.uid);
const openRoomsQuery = notMineRoomsQuery.where("user2", "==", "");
How can I do this in a fairly simple way (possibly without putting user fields to a single array field)?