Back

[BUG UNDER FIX πŸ› ] Creating Documents relationship

  • 0
  • Databases
  • Flutter
hortigado
13 Apr, 2023, 07:34

Hello, in the relations documentation it is not seen that it is necessary to add the $id. But it throws error 500 if it is not added. await databases.createDocument( databaseId: 'marvel', collectionId: 'movies', documentId: ID.unique(), data: { 'title': 'Spiderman', 'year': 2002, 'reviews': [ { "\$id": ID.unique(), //add id 'author': 'Bob', 'text': 'Great movie!' }, { "\$id": ID.unique(), //add id 'author': 'Alice', 'text': 'Loved it!' } ] }, );

TL;DR
The user reported an issue with creating document relationships in Appwrite. The error message was a 500 error. The user mentioned that in the relations documentation, it is not stated that adding the $id is necessary, but without it, the error occurs. The user provided an example code snippet that includes adding the $id. Solution: Add the $id to the document relationship in the code snippet to avoid the error.
Arth
13 Apr, 2023, 07:36

which appwrite version are you using and can you share the link to the documentation which you're referring

hortigado
13 Apr, 2023, 07:37
hortigado
13 Apr, 2023, 07:37

flutter: 9.0.0

Arth
13 Apr, 2023, 07:37

which appwrite version are you using? what's the error message

hortigado
13 Apr, 2023, 07:37

1.3.1

Arth
13 Apr, 2023, 07:38

and the error message?

hortigado
13 Apr, 2023, 07:39
Arth
13 Apr, 2023, 07:39

that is weird, let me try it myself

hortigado
13 Apr, 2023, 07:40

ok friend

Jake
13 Apr, 2023, 08:05

Hey, thanks for letting us know, this issue has a fix in the works now

joeyouss
13 Apr, 2023, 08:21

[BUG UNDER FIX πŸ› ] Creating Documents relationship

furyan
16 May, 2023, 16:36

Is there a link to track the status of the issue?

Jake
19 May, 2023, 07:12

This is fixed in the latest release 1.3.4 πŸ˜„

hortigado
19 May, 2023, 07:39

great πŸ’―

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