MaxouOriginal post
Web Developer
If one document is in DB, every other attempt will have a 409. I only have userId that is required, no index, no relation
My code :
JavaScript
databaseService .createDocument( env.appwrite.db.id, env.appwrite.db.collection.userdata, ID.unique(), dataWithoutUserName )An example a payload : {"documentId":"67f83f3e001deb9d46da","data":{"roles":[],"city":"Paris","userId":"679d2f914100ccaad8e6"}}
(documentId is different at each request)
Summary
Error 409 occurs when trying to create a document with an existing ID in the database. The issue is because a unique ID is not generated for each request. To fix this, ensure a unique ID is generated for each document creation to avoid conflicts.