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
- Seed db
hello there... is this correct way to seed appwrite
- Query Appwrite
Hello, I have a question regarding Queries in Appwrite. If I have a string "YYYY-MM", how can I query the $createdAt column to match this filter?
- Type Mismatch in AppwriteException
There is a discrepancy in the TypeScript type definitions for AppwriteException. The response property is defined as a string in the type definitions, but in pr...