Back

How to update a document from a localhost nodejs app?

  • 0
  • Databases
Mr English
7 Jun, 2024, 08:17

I am trying to use a nodejs application on localhost, to create documents. Can you tell me how to go about this, for example, how to set the permissions. Thanks.

TL;DR
Developers are encountering an error when trying to create a document in AppWrite: "Invalid `documentId` param." The error arises as the ID shouldn't exceed 36 characters and have specific valid characters. Check the Appwrite documentation for assistance, especially on setting permissions: https://appwrite.io/docs/advanced/platform/permissions. In a nodejs app from localhost, grant permissions by creating a user and role, enabling the required permissions (Create, Read, Update, Delete).
Afrin Nahar
7 Jun, 2024, 08:30

Appwrite docs would be a great place for this. For setting permissions, you can follow this doc: https://appwrite.io/docs/advanced/platform/permissions

Mr English
7 Jun, 2024, 08:38

Thanks @Afrin Nahar In AppWrite, I have created a User and created a Permissions Role for the User and enabled Create, Read, Update and Delete However, I get this error:

Error creating document: AppwriteException: Invalid documentId param: Parameter must contain at most 36 chars. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char This is an example data row: 5/31/24 15:31:35|Stockport|England|Stockport|email@gmail.com|-|False

Mr English
7 Jun, 2024, 08:40

My collection attribute data types are: DateTime String String String String String Boolean

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