π
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
- Not allowed permission to upsert a prese...
```js const presenceID = ID.unique(); setPID(presenceID); const presence = await presences.upsert({ presenceId: presenceID, status: "online"...
- Finding job
Hi. I am a full-stack developer with experience in developing scalable and user-friendly web applications. I handle both front-end and back-end development, im...
- CDN not delivering correct bundle
My site 69b4cd410035893573dc is not delivering the latest deployed version via CDN, it seems stuck on versions from previoiu days, alternative links for the lat...