Back

[SOLVED] Getting empty array back for a one to many relationship

  • 0
  • Databases
djcali
2 May, 2023, 04:19

Hello I have an Events Collection and an EventDiscussion collection where I have set up a one to many relationship where an Event can have many discussions. In the console I added an event discussion document to an event but when I query the event I see that the event discussion relationship has an empty array when clearly the console has a document attached. Is this a bug or should i be doing anything different. Seems pretty straight forward. Thanks!

TL;DR
Issue: Empty array returned for a one to many relationship in Appwrite's EventDiscussion collection. Solution: The problem was due to permissions not being set on the discussions collection. Setting the appropriate permissions should fix the issue. Additionally, the user mentioned using the migration tool and provided their Appwrite version as 1.3.3.
Drake
2 May, 2023, 04:20

What version of Appwrite?

djcali
2 May, 2023, 04:20

Also I am using 1.3.3

djcali
2 May, 2023, 04:20

and I used the migration tool

Drake
2 May, 2023, 04:21

What permissions on both collections?

djcali
2 May, 2023, 04:21

ahhhhhhhh. didn't set permissions on the discussions collection. Let me check that. 😆

djcali
2 May, 2023, 04:23

That was the issue. Sorry sometimes I'm just hurrying and don't look for the obvious.

djcali
2 May, 2023, 04:58

[SOLVED] Getting empty array back for a one to many relationship

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