Skip to content
Init is coming / May 19 - 23
Back

Relation with user

  • 1
  • Users
  • Databases
HoXsan
31 Aug, 2023, 22:38

Hi,

This might have been asked few times, so sorry already, but could not find anything.

Is there a way to create a relation to user in a collection?

Or do I have to store plain ID as text and lookup users table by ID? If that is the case, how can I make some certain values in users to be visible for authenticated users only?

TL;DR
The user wants to know if there is a way to create a relation to a user in a collection, or if they have to store the user's ID as plain text and look it up in the users table. They also want to know how to make certain values in the users table visible only to authenticated users. The response suggests that there is no native way to create a relation to a user in a collection currently, but it may be planned for the future. In the meantime, the user can mimic the relation by adding a user ID field or setting the document ID to the user ID. To make certain values in the users table visible
Binyamin
31 Aug, 2023, 22:51

Not for now, as of now you'll need to mimic it by adding user_id field (or set the document ID to the user ID in case of one-to-one) to the collection As for the visibility for specific user Appwrite got you cover and you can use the permissions module.

HoXsan
1 Sep, 2023, 00:24

Do you know if there will be more native way to do it in the future?

Binyamin
1 Sep, 2023, 00:25

I can't find any feature request on that right now but I think its planned

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