Back

Create a document without adding data to non-required attrs.

  • 0
  • Databases
  • General
  • Cloud
Ryan Baig
23 Aug, 2024, 06:13

Basically, I am making a discord bot and using appwrite's db for the settings. here is my code:

TypeScript
db.create_document(
                database_id=dbname,
                collection_id=scol,
                document_id=str(interaction.guild.id),
                data={}
            )

and in the ss you can see, all my attributes are non-required. however, Appwrite gives me this error (in the next msg since the error too long) Help me bypass this.

TL;DR
Error: Appwrite is giving an error when creating a document with non-required attributes and empty data. Solution: Instead of providing an empty dictionary for data, only include the required attributes when creating the document.
Ryan Baig
23 Aug, 2024, 06:13

this is the error

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more