Back

can't create two relationship type attributes pointing to the same collection

  • 0
  • Databases
  • Cloud
manazo
6 May, 2024, 00:42

when i try to do this, i get the "Attribute with the requested key already exists" error. maybe an example of my scenario would be more helpful. think of a chats collection in a messaging system. the app has a users collection as well. so in the chats collection, there'll be two obvious attributes as sender and recipient. and both of these relationship type attributes need to point to the same collection, which is users. and this doesn't seem to be possible rn in Appwrite cloud?

TL;DR
Developers are experiencing difficulties creating two relationship type attributes pointing to the same collection in Appwrite. The error "Attribute with the requested key already exists" occurs when attempting this. A suggestion is to manually make the API call to set a unique two-way key. Currently, it may not be possible to achieve this in Appwrite cloud based on the provided scenario with a _chats_ and _users_ collection.
Steven
6 May, 2024, 00:45

For now, it might be possible to make the API call manually so that you can set your own unique two way key

manazo
6 May, 2024, 00:47

u mean to create the attribute using node-appwrite?

Steven
6 May, 2024, 00:47

Ya, or CLI

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