anantiikenna / socio_max

A social app
https://sociomax.netlify.app/
2 stars 1 forks source link

can you explain the steps of relationship collection #2

Closed shubh1777 closed 1 month ago

shubh1777 commented 1 month ago

Please explain the attributes of relationship collection of appwrite.

anantiikenna commented 1 month ago

I created a Relationship collection in appwrite following this format

Collection: Relationship Attribute: followerId , followingId and createdAt

followerId: String, required. (References the user ID of the follower) followingId: String, required. (References the user ID of the user being followed) createdAt: Date, Default value NULL, required. ((References date user follow relationship)

the idea is to store userB that decided to follow userA

let assume that userA is the current user.

if userB where to follow userA userB-id will be store in followerId of userA .

and if userA where to follow userC , userC-id will be store in followingId of UserA.

this goes the same for every users

so presently,

userA followerId has { userB-id } and followingId has { userC-id }

while in userB followingId has { userA-id}

and userC followerId has { userA-id }

Hope that helps

shubh1777 commented 1 month ago

Thanks. That helped a lot