When I try to create a document with a ID which is already present . it throws wrong error saying "The current user is not authorized to perform the requested action." it should actually show. " Document with the requested ID already exists. Try again with a different ID or use "unique()" to generate a unique ID."
NOTE:
- Role is "any" for all collection. so no issue with authorization.
- Authroization error doesn't show up on first time creation of nested object.
- Above is only happening for relationship (nested document) not the direction collection documents.
const testDataSave = async () => { await databases.createDocument(DATABASE_ID, "users_id", "random_doc_id", { basicDetails: { $id: "random_doc_id", name: "randome name", age: 31 }, }); };
does some document exist with that id in the related document?
yes it exists
that may be the duplicate error problem then...does the user have access to the document?
yes user has the access.
collecttion is given the with persmission of any
If you remove the related document from the creation, do you get the error? You'll probably need to include some data or maybe permissions so you don't get a missing data error
Recommended threads
- Seed db
hello there... is this correct way to seed appwrite
- Query Appwrite
Hello, I have a question regarding Queries in Appwrite. If I have a string "YYYY-MM", how can I query the $createdAt column to match this filter?
- Different appwrite IDs are getting expos...
File_URL_FORMAT= https://cloud.appwrite.io/v1/storage/buckets/[BUCKET_ID]/files/[FILE_ID]/preview?project=[PROJECT_ID] I'm trying to access files in my web app...