BloodThermicOriginal post
Rank 3: Container
I keep getting this error when creating a document.
AppwriteException [Error]: Attribute with the requested ID already exists. Try again with a different ID or use "unique()" to generate a unique ID.
This is the line of code that is breaking ```
const data = {
Email: Email,
accountId: accountId,
collectionId: collection.$id,
};
let dataLink = await databases.createDocument(
"64502243369b884d71f8",
"647295a5228d3bd685da",
ID.unique(),
data
);```
Here is the imports
Plain text
import { PUBLIC_API_ENDPOINT, PUBLIC_PROJECT_ID } from "$env/static/public";import { PRIVATE_API_KEY } from "$env/static/private";```Summary
The user is encountering an error "Attribute with the requested ID already exists" while trying to create a document. The code they provided includes the use of `ID.unique()`. The solution suggested by the error message is to either use a different ID or utilize the `unique()` function to generate a unique ID.