👀
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
- Invalid document structure: missing requ...
I just pick up my code that's working a week ago, and now I got this error: ``` code: 400, type: 'document_invalid_structure', response: { message: 'Inv...
- custom domain with CloudFlare
Hi all, it seems that CloudFlare has blocked cross-domain CNAME link which made my app hostname which is in CloudFlare, unable to create a CNAME pointing to clo...
- Custom emails
What happen if I use a third party email provider to customize my emails and my plan run out of emails/month? Appwrite emails are used as fallback sending emai...