Back

[SOLVED] Relationship: How can I relate the attribtue to the specific or array of User?

  • 1
  • Users
  • Accounts
  • Databases
  • Tools
Suiii
28 Jul, 2023, 13:03

Relationship: How can I relate the attribtue to the specific or array of User?

TL;DR
There was a question about how to relate an attribute to a specific or array of users. The solution suggested was to manually handle the relationship between users and documents, as the users API and databases are separate entities. To create a relationship, it was recommended to create a users collection where the user's name and document ID's match the user ID. This way, the relationship can be established and used as needed.
Tomic R.
28 Jul, 2023, 13:04

I would be interested in that too

D5
28 Jul, 2023, 13:24

If what you want is to relate an user with a document, you will need to handle that manually, since users API and databases are different things that cannot be related.

If you want the user name, for example to be publicly available (for example, blog posts), you will need creating a users collection with user's name and document ID's being the same as user ID, and that will be related as any other documents

Suiii
29 Jul, 2023, 15:16

that would be an option.

Suiii
29 Jul, 2023, 15:17

but need to keep in sync all the create.

D5
29 Jul, 2023, 15:17

When the user click registering button, you trigger a function and create the corresponding document

D5
29 Jul, 2023, 15:18

So it will be kept in sync

Suiii
29 Jul, 2023, 15:18

thanks. that would be possible.

D5
29 Jul, 2023, 16:32

[SOLVED] Relationship: How can I relate the attribtue to the specific or array of User?

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