Invalid `documentId` param: UID must contain at most 36 chars. Valid chars are a-z, A-Z, 0-9, and un
- 0
- Databases
- Flutter
- Self Hosted
in Flutter App i have a class, let's call it the car class.
i create a new Car:
Car( id: ID.unique(), created: true, )
and on other place there is a function which is called: if car.created == true:
...databases.createDocument( databaseId: ENV.APPWRITE_DB, collectionId: ENV.CAR_COLLECTION, documentId: car.id, data: car.toAppwrite(), );
my problem is: i get this error in return:
AppwriteException: general_argument_invalid, Invalid documentId
param: UID must contain at most 36 chars. Valid chars are a-z, A-Z, 0-9, and underscore. Can't start with a leading underscore (400)<…>
would be great for any solutions and explanations of the reason.
What does your car ID look like ?
Would help if you print the value of car.id before you make the call to createDocument()
i get: "unique()" in return
are you able to open your app on the browser and inspect the network request?
hm, i can try to check it with the dev tools
yea that would be helpful 👍
request uri: https://appwrite.domain.com/v1/databases/alpha_db/collections/car/documents/unique() method: PATCH status: 400
request: {"data":{"title":"test2"}}
response: {"message":"Invalid documentId
param: UID must contain at most 36 chars. Valid chars are a-z, A-Z, 0-9, and underscore. Can't start with a leading underscore","code":400,"type":"general_argument_invalid","version":"1.4.13"}
You;re hitting the updateDocument
endpoint as indicated by the PATCH method
so you're trying to update a document with id unique()
which does not exist
lol you right
Hope that solves the problem ?
yes, thank you very much
No worries 👌
Recommended threads
- Having issues with login via CLI
``` ~/appwrite appwrite login --endpoint https://localhost/v1 --verbose ? Enter your email myvalidemai...
- Attributes Confusion
```import 'package:appwrite/models.dart'; class OrdersModel { String id, email, name, phone, status, user_id, address; int discount, total, created_at; L...
- How to Avoid Double Requests in function...
I'm currently using Appwrite's `functions.createExecution` in my project. I want to avoid double requests when multiple actions (like searching or pagination) a...