The structure of the table is:
- chats
- --> randomId
- -->--> participants
- -->-->--> 0: 'name1'
- -->-->--> 1: 'name2'
- -->--> chatItems
etc
What I am trying to do is query the chats table to find all the chats that hold a participant by a passed in username string.
Here is what I have so far:
subscribeChats(username: string) {
return this.af.database.list('chats', {
query: {
orderByChild: 'participants',
equalTo: username, // How to check if participants contain username
}
});
}