I have collection of chats
and I want to search through this collection by chat's members. Collection looks like:
{
...
owner: 'user-123',
members: ['user-123', 'user-456'].
membersData: [{
id: 'user-123',
name: 'Jack'
},
{
id: 'user-456',
name: 'Jane'
}
]
...
}
The reason of this that I can't search by members' ids using array-contains
if members are objects. Is this solution OK? I have a very small experience in firebase (and noSQL databases generally) so may be there are best practices for this type of tasks?