Rank 1: Thread
still no luck!
Votes
1
Replies
24
Participants
Unknown
Messages
25
Rank 1: Thread
still no luck!
Rank 4: Virtual Machine
You didn't set database ?
Rank 1: Thread
Rank 1: Thread
I created this db!
Rank 4: Virtual Machine
So you need to set ID here
Rank 1: Thread
yes I did
Rank 1: Thread
e.preventDefault(); const promise = await databases.createDocument( "6471bb9750ced865202e", "6471bbb56256066bc8e1", uuidv4(), { todo, } ); console.log(promise); promise.then( function (response) { console.log(response); }, function (error) { console.log(error); } ); //window.location.reload() // handle it in different way e.target.reset(); // window.location.reload(); };Rank 4: Virtual Machine
Check your code cause somethings wrong with the url called. There should be no undefined here
Rank 1: Thread
is my config file correct?
Rank 1: Thread
I didn't find anything wrong in my code!
Rank 1: Thread
User is logging in and out to the system
Rank 1: Thread
only Database has issue
Rank 1: Thread
This code is same as the documentation
Rank 4: Virtual Machine
Isn't your code crash after ? You use await AND .then on promise already resolved
Rank 4: Virtual Machine
For now I've no idea, just know that you need to fix "undefined"
Rank 1: Thread
I am new to appwrite. so I dont understand why this behaves like this
Rank 4: Virtual Machine
Someone else will answer you later 🙂 Keep focus
Rank 1: Thread
Hey
Rank 1: Thread
I fixed the issue
Rank 1: Thread

Rank 1: Thread
Basically We need to pass the database_id in when we call database like this const databases = new Databases(client, "DB_ID")
Rank 1: Thread
"COLLECTION_ID", uuidv4(), { todo, } );```Rank 1: Thread
This is the modified code to create a document, same is applicable for all CRUD operations
Rank 4: Virtual Machine
Great that you find a solution. Don't forget to add [SOLVED] at begin of your post title
Rank 1: Thread
[SOLVED] Can't create a new Document , Giving error as 'Value must be a valid JSON string'