For example, I have Followers collection. I want to add fields with the id of the user who is follower and the id of the user who is followed. ANd I want to use relationship for this to get any info about users when I'll fetch data. So my structure must be like this:
id (string) user_id (relationship to users | one way - many to one) follow_id (relationship to users | one way - many to one)
But problem is I can't use relationship to the same collection. So may be my logic is wrong and I need to do it another way? But I think it would be very convenient and logical to do it this way.
You need to have multiple collections for this case:
- Users (here the name, etc)
- Followers
Inside the followers you have 2 attributes: the ID from the one that follows and another attribute for the ID from the one that is being followed
Recommended threads
- New attribute stuck on processing?
I was running out of disk space and after creating an attribute and restarting my appwrite (self hosted) I have an attribute stuck on creation. Any way to remov...
- Bug: When creating a table, table name i...
I created a table with a typo. my_taable .... then my code couldn't find it. i updated table name and still couldn't find it. the table name doesn't update. i h...
- unexpected row_invalid_structure error
In images you can see both my code,error, column schema I do have timezone in table schema but still while creating a row i am receving row_invalid_structure e...