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
- SSL certificate issuance failed:
Domain verifies but SSL cert fails, tried different subdomains like .api and .aw, used cname and CAA, no prior CAA existed on website, tried Multiple CAAs at on...
- Password check in function
Hi, is there any way now for checking if the users password is correct in a function? I am creating a delete user function and before deleting I would like to c...
- Deployment fails after 15+ minutes: "Wai...
Hi, I'm Jayden. My email is jaydthom@haverford.org, and i'm having persistent deployment failures with my Next.js project. What happens: Push to GitHub trigg...