π
Do you know what this does?
databases.createDocument('64502243369b884d71f8', '6450225bbca140600f16', ID.unique(), {name}, {DOB}, {feet}, {inch}, {weight}, {school}, {sport}, {position}, {age}, {better})
e.g. what this is? {name}
yes I do
They are all form inputs
I have also tried without the brackets and samething
you know that {name} is the same as {name: name}?
What do you mean Im confused
{name} is syntactic sugar for {name: name}
This is the output I get when I do no brackets
AppwriteException [Error]: Invalid data: Value must be a valid JSON string
at Client.call (C:\Users\canno\Desktop\Work\Clients\Phelps-Fitness\phelps-fit-2\node_modules\node-appwrite\lib\client.js:172:31)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Databases.createDocument (C:\Users\canno\Desktop\Work\Clients\Phelps-Fitness\phelps-fit-2\node_modules\node-appwrite\lib\services\databases.js:1666:16) {
code: 400,
type: 'general_argument_invalid',
response: {
message: 'Invalid data: Value must be a valid JSON string',
code: 400,
type: 'general_argument_invalid',
version: '1.2.0'
}
}
how many arguments does createDocument() expect?
10
no
Oh your asking for appwrite
Well I am guessing only 1 by how this is working out for me
no
Ok I am understanding now I think. I just figured out how to do what you just did. so 5 arguments
So I need to put it into an array then use it?
no
Got it!!!
Name: name,
DOB: DOB,
Feet: feet,
Inch: inch,
Weight: weight,
School: school,
Sport: sport,
Position: position,
Age: age,
Better: better
};```
Thank you!!
[SOLVED] Document Creation
Recommended threads
- Problem with Google Workspace at DNS Rec...
Hello, I bought a domain at Namecheap, and Google Workspace used to work there, but now that I switched from Custom DNS to Appwrite's nameservers, it doesn't w...
- change role of a team member in Appwrite
It's not possible to add/change roles of a team meber in Appwrite Frontend. When you click on a member of a team you get forwarded to the configuration page of ...
- Session not found. Please run appwrite l...
I have encounter an issue with appwrite CLI They asking for a login session but in the doc, itβs mention that only setup client with endpoint / api key is enou...