Rank 1: Thread
Hey, I'm trying to setup a proper database structure for my basketball game data app and would like to incorporate relations to avoid duplicate data.
I'm on the free Appwrite Cloud plan, so I have one Database available.
My use case is this:
I have two different types of Collections: Player and League.
A League has documents representing basketball game stats, one document per game per player.
A Player has their overall points and so on, essentially only one document in this collection.
The Relation I want to introduce is in the form of linking a Player to their played games in the respective leagues.
Player can have many games
Game can have 1 Player, so I selected the one-to-many relationship.
But, at least in the console, it's kinda confusing to select the attributes to use. I was trying to use leagueGames for the player collection and player for the league collection. This worked well for 1 player, but when i create the Relation in a collection for a second player, it cant create a relation attribute with the same key.
So this essentially defeats the purpose that I save data, because now I have to create ANOTHER attribute (e.g. leagueGames2) where I can select the second player.
What am I missing? I want to link different documents from a league collection to different players, is this currently possible?
Maybe I am approaching it from the wrong side, but when I try to create it from the league side, I have to choose only one collection to link.