
So you basically need to put payload between {}

Also make sure it fills all required data, since if it's not filled, a document will not be created

Done

It's not working

Do you have set permissions in the collection?

e.g. go to the collection you want to insert the document in and give 'Any' permission to read and insert and then see if you are able to create the document

If having token, that's not required

what's the error? also, instead of console.log(error)
, would you please change it to console.log(error.toString())
?

There is none it's just going to show that response and there is no doc made.

Did you try again after switching to err.toString()

this

nice. did you use localhost as your endpoint?

hopefully no


would you please check the APPWRITE_FUNCTION_ENDPOINT
variable?

sure

this code is working locally when I run directly this module on a server, but on appwrite function its not running :(

yup that was the error

but shouldn't
APPWRITE_FUNCTION_ENDPOINT
already have the endpoint details?

Steven any idea how to skip the build step for ts npm run build
before uploading the build. Like its too tedious to first build and then ship.

It working now!

We're addressing this in the near future

I still have the problem with APPWRITE_FUNCTION_ENDPOINT
. I tried localhost (should not work in docker environment) and the ip of my local computer. i still get Error: getaddrinfo ENOTFOUND hostname

Okay after set api key and endpoint everything works.

[SOLVED] Not able to create document with function
Recommended threads
- 404 error when navigating to the team fr...
the version i m running is `1.7.4` as far as i can tell everything is working fine except for this weird bug in the video. when monitoring the appwrite and app...
- Query params are way too limiting in ter...
I was trying to list rows in a table that do not already exist in another table. I retrieved around 260 row IDs which are 13 characters in length each, and then...
- [Node.js SDK] Bypass 2GB file limit?
Hello. Using either InputFile.fromPath or InputFile.fromBuffer throws this error: File size (2295467305) is greater than 2 GiB Bucket limit etc. is setup corre...
