iOS Swift – Firestore db structure


Im trying to use firebase firestore for an app. Im trying to figure out the correct way to structure. So my app has a login system so it has a “users” table where each user has the a couple of values like their name and number of games played. Now each player will be able to have various “games” that are ongoing .
So my question is ,should i have a “users” table (firebase collection) and a “games” table with the userId as reference or should i have one users table where i have an array of game objects

where i have 2 collections

where i have just 1 collection

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img