Back

How to add more data from one documentid

  • 0
  • Databases
  • Web
Ashish Nagvanshi
31 Mar, 2024, 04:29

hey basically currently i am learning about appwrite database. so when user signup and a button gonna render on there screen and then when user click on that button then i have created some array data so that data gonna be added inside database but next time when same user logged in and then click on that button then console give the error console is

saying AppwriteException: Document with the requested ID already exists. Try again with a different ID or use ID.unique() to generate a unique ID.

but i want every time same user logged in then there data gonna be added to there id only not any unique id , if you need more clearity of the problem please let me know

TL;DR
When a user logs in and clicks a button, the data is supposed to be added to their existing document ID in the Appwrite database. However, each time the user logs in and tries to add data, an error occurs stating that the document already exists. To resolve this, use the user's unique ID for storing data instead of creating a new one each time they log in.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more