I am using the following database structure.
Which is the same as presented in the official documentation
// Conversation members are easily accessible
// and stored by chat conversation ID
"members": {
// we'll talk about indices like this below
"one": {
"ghopper": true,
"alovelace": true,
"eclarke": true
},
"two": { ... },
"three": { ... }
},
I want to check if there is already a chat with those users so they don't create duplicated.
This is what i'm trying
final snapshot = await _database.ref().child("members").child(firstUserId).get();
but this is not finding anything because the chatId
is first. Is there a way to do this or a better database structure?
I hope you can help me. Thanks in advance.