Rank 1: Thread
I am creating a sports app. we have leagues that we have a league_teams attribute that is a relastionship with our league_teams collection. I used this code
const newTeam = await databases.updateDocument(
process.env.NEXT_PUBLIC_APPWRITE_DATABASE!,
process.env.NEXT_PUBLIC_APPWRITE_COLLECTION_LEAGUES!,
leagueId,
{
leagueTeams: [
{
$id: ID.unique(),
name: teamName,
players: players,
},
],
}
);
did add the new team to the relationship, but it removed all of the other teams that had relastionships with the collection.
Is there a way to add and remove 1 team at a time to the relationship in one step, or will I need to create the team in the teams colection and then add it to the relationship attribute?