PoptOriginal post
Rank 2: Process
My code:
await databases.createDocument(
process.env.APPWRITE_DATABASE,
process.env.APPWRITE_COLLECTION_USER,
data.userId,
{},
[
Permission.read(Role.user(data.userId)),
Permission.update(Role.user(data.userId)),
]
);
It keeps throwing this error at me, but the thing is that all the fields in my user collection are optional, so there is no reason for me to set any fields right?
Summary
The user is facing a database error when trying to create a document in a collection, despite all fields being optional. The issue seems to be related to the setup or formatting of the function `databases.createDocument()`. Be sure to check for any missing or incorrect parameters. Be cautious if any specific fields are actually required, even if defined as optional. Consider verifying the syntax and parameters used in the creation method.