👀
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
- [ENHANCEMENT] Use the custom Next.js dep...
Deployment adapters on Next.js are now stable! This means that we don't have to stick to the limitations of sniffing out build outputs and manually moving or mo...
- NextJS builds sudden runtime_timeout
My builds suddenly stopped working. Activating old prebuilt snapshots work, but redeploying that same code produces builds that throw runtime_timeout FRA region
- Project paused?
Hello, I have two Appwrite projects and I can not resume them for some reason. I'm using the free plan, and I saw in the pricing page that 2 free projects are a...