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?
Recommended threads
- Creating A User Account
I have a simple form component that is expected to create a new user using the the ###firstName, ###lastName, ###username, and ###password from a react-hook-for...
- project block by using functions
i just revieved this email because my project got block,but still i dont know why it happend
- after trying to execute function using f...
is there a speicifc way to execute ,request a function?