The user is having trouble deleting an item in a React app. They are trying to use `databases.deleteDocument` to delete a document with a specific ID. They are unsure if the ID should be passed as a variable or inside quotation marks. The error they are receiving is "can't find document id."
Solution: Make sure the ID is being passed correctly. The correct format for the `databases.deleteDocument` function should be: `databases.deleteDocument('[DATABASE_ID]', '[COLLECTION_ID]', '[DOCUMENT_ID]');`. Verify that the `id` variable is being properly passed as the last argument.
Ajay
Rank 1: Thread
Apr 2, 2023, 12:50
The error is can't find document id
darShan
Apr 2, 2023, 13:09
are you passing the document id or just 'id' as the last argument?
darShan
Apr 2, 2023, 13:10
Should be like - databases.deleteDocument('[DATABASE_ID]', '[COLLECTION_ID]', '[DOCUMENT_ID]');
Ajay
Rank 1: Thread
Apr 2, 2023, 13:18
It is a document id I am passing the id through click
Ajay
Rank 1: Thread
Apr 2, 2023, 13:18
Basically it's an react app
darShan
Apr 2, 2023, 13:25
should it be inside " " then if its a variable? 👀
darShan
Apr 2, 2023, 13:28
It should be const response = await databases.deleteDocument("6427c6d20464df58bf36", "6427c6dcd6bc73a91b81", id);, I guess.