I'm trying to make a chat app that can have chatrooms with max two users.
I got a collection chatrooms and chatroom-documents with an array field members that contains two user id's.
Know before I can create a new chatroom I want to check if two specific users already got a chatroom together, so I need to query the two user id's with my documents.
In the end I just want to check if a chatroom exists and then return false then trying to create another chatroom with the same two specific user id's.
My problem is the query of the array content.
I tried with
chatroomsCollection.where('members', '==', firstUserID).where('members', '==', secondUserID).limit(1).get()
and tried
chatroomsCollection.where('members','array-contains', firstUserID).where('members', 'array-contains', secondUserID).limit(1).get()
but it doesn't work.
Is it even possible to query multiple strings with elements inside an array in noSQL?