I need to list all messages where playerExcluded != firebase.auth().currentUser.uid for each user.
roomId
|__ messageId
|__ author: string;
|__ message: string;
|__ playerExcluded: string;
I'm doing that for now with a Cloud Function but I don't think this is a good practice since messages need to be update when there is a new message (=often): this is very costly (a lot of calls to cloud function).
Is there a good way to do that ?
PS/Irrelevant: Is it possible to restrict database query on only one type of query ? Sample example:
passwords
|__ roomId: passwordValue
I need to check if the password inputted by the user is right. No problem doing the query doing that. But given that firebase rules with write/read is true OR false, I guess answer is no, can some one confirm it ?