Back

How to add friends

  • 0
  • Databases
Microbe_jc
1 Jul, 2024, 21:11

Hello community! Maybe my question is a bit dumb… but, I will try my luck here 🙂 in my database, I am having users as a collection, and I want users to have friends (who are also users), but in “relationship” i could’t choose its own collection. What should I do? Thank you!

TL;DR
To add friends in your database, you can create an array attribute of user IDs in the user collection. This way, you can fetch the profiles of friends when needed.
Kenny
1 Jul, 2024, 21:16

self relationships are not a thing currently, off the top of my head I think having an array attribute of user ids would be fine, and then you would fetch those profiles when necessary.

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