Back

Help related to database structure

  • 0
  • Databases
  • General
  • Web
  • Cloud
Examinor
31 Mar, 2024, 13:08

I need help in my social media project instagram clone I am using appwrite cloud as backend I have a User collection which store related to user like email, name ,username,bio,profile pic etc I have a Post collection which store post which user created and it is related to user I want a functionality where user can follow someone and then in profile page we can view how many user follow us and how many we follow I am not able to understand how should i create a new collection and relate it to user and then achieve above result Can someone help me with that ?

TL;DR
Developers are seeking help with setting up a follow functionality in their Instagram clone project using Appwrite Cloud. They are unsure how to create a new collection related to users to achieve the desired result. Solution: Create a new collection called 'Followers' with fields like follower ID and following ID to track user relationships. Each time a user follows someone, create a new document in the 'Followers' collection with the follower's ID and the following ID. To display follower and following counts on the user's profile, query the 'Followers' collection based on the user's ID.
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