Skip to content
Back

I need help in appwrite collection relationship.

  • 0
  • Databases
  • Web
Anas Siddiqui
16 May, 2024, 10:12

I am working on a side project and using appwrite i am currently implementing comments functionality for this i am using a separate comments collection and inside this collection we have three attributes the first two attributes is the relation with the other two collections post collection and the user collection and the relation type is many to many because many users can create many comments and many posts can contains many comments. But in many to many relation we need to pass the id's in an array but i don't know how can i do this. Please help me.

TL;DR
Developer needs help uploading an array of user IDs and posts in Appwrite collection relationship for comments functionality. Wants to test how relationship works and make it easier to filter. Considering saving post ID as a string instead of using relationship. To upload IDs in an array, use many-to-many relation type.
D5
16 May, 2024, 10:31

No need to ping Steven πŸ˜…

Anas Siddiqui
16 May, 2024, 10:31

oh

Anas Siddiqui
16 May, 2024, 10:31

sorry

Anas Siddiqui
16 May, 2024, 10:31

i thought that he will reply me

Anas Siddiqui
16 May, 2024, 10:31

lol

D5
16 May, 2024, 10:32

At least in the case of posts, I think it's better not using relationship and save the ID of the post as a string

D5
16 May, 2024, 10:32

That way it will be easier to filter, etc

Anas Siddiqui
16 May, 2024, 10:34

i just want to test that how relationship works that's why i want to do this

Anas Siddiqui
16 May, 2024, 10:35

but i dont know how can i upload the array of user ids and the posts

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