I am making a clone of Trello
I am trying to figure out what the best way is to get a list of all the boards that the current user is a member in.
First i thought ill have a collection like "Boards > boardId > members > userId" and just add members to that list when a new user is invited/added to the board. This way i don't have to repeat data across users and keep it all in one place, along with the title of the board. Also i could use this collection to get a list of the board members to display on top of the board.
But then i realised its pretty much impossible to query in this database. I don't know how i would query to get a list of boardIds that contain a specific userId. I tried stuff like
myFirebase.database().ref('/boards/').orderByChild('uid').equalTo(user.uid) ... but it obviously doesn't work.
Do you guys have any idea how i can solve this? is there some simple solution here that im to stupid too see..? Or do i maybe have to use a separate SQL database for this? :(
Example picture of the database