I'm building an app using Firestore, where a group of people need to be able to access an object, and I followed the guide at https://firebase.google.com/docs/firestore/solutions/role-based-access. So, my object looks a little bit like this:
{
title: "A Great Story",
content: "Once upon a time ...",
members: {
alice: "host",
bob: "player",
david: "player",
jane: "player"
}
}
Those keys in members are simply User UID's, so in reality they don't look quite as nice of course :)
Now, this all works fine, I can query objects that the currently logged in user is a member of, all the rules are working and stuff. But, now I want to show the list of members in my app. How can I query the Firebase Auth system for the users in my members map?
And if that is not possible, what is the "normal" way to solve this? Have a copy of the user information (name, email, profile picture) in the document itself? But how do you handle a user changing any of own info? Then the document has stale old data..
I'm coming from a traditional relational database world, these are my first steps with a NoSQL database / Firestore, so it's not really clear to me how to best structure my user data and keep it up to date.