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
- how to access the value of account statu...
- I can't UNPAUSE my project with the free...
I received an email notifying me that my project had been paused due to inactivity, and the email included a link to "Restore project." However, that button red...
- How to bypass the rate limit on the back...
Once a month my app has a ton of usage and I always run into the Too many requests 429 error. I am trying to optimize the queues and jobs to manage that, but a...