
I am creating a Flutter application containing the following data: Contact (of a person) containing mobile, email, permanent address, local address, communication address, etc.
I have created two collections namely, contact and address. The contact has the following fields: mobile, email, permAddr (permanent address), localAddr (local address), and commAddr (communication address), etc. Each of the address fields are expected to have one-to-one relation to the address collection. However, it is not possible to create three one-to-one relations between contact and address collections. I get the 'failed' error in the console when I create second and third one-to-one relations.
It is possible to create one-to-many relationship. However, it will require 'address' relation field to be an array, which I do not want. I wish to keep these three fields separate as mentioned above.
How to handle this situation?

Relationships are between two Documents, not specific Attributes within Documents

Thank you very much. Does it mean that the specific example cited above cannot be handled by Appwrite? Shall I put a request in github for including this support in AppWrite?

There's a currently open Pull Request to prevent creating multiple Relationships between the same Collections (instead of just getting failed
, as you do now). However, I would assume this is more of a UX thing than a will to not allow it. So I would say yes, do create a Feature Request (https://github.com/appwrite/appwrite/issues/new?assignees=&labels=feature&projects=&template=feature.yaml&title=%F0%9F%9A%80+Feature%3A+).

I wouldn't expect it to come very soon, though, as from my understanding, this would require a rework of how Relationships are represented in Appwrite.

Thank you very much for your reply.

The new issue: https://github.com/appwrite/appwrite/issues/7288

sooooo did you create a one-way or two-way relationships?

I wanted to create one-way relationship. But the application needs to have multiple one-way relationships between two collections. I have suspended the development for the time-being and awaiting for the solutions from the Appwrite team.

Soo think you're facing the problem in this issue: https://github.com/appwrite/appwrite/issues/6281. The problem is there is still a column added to the related table and if you don't specify the column name, it causes a conflict. So, for now, you'd have to create two way relationships and specify the related key. You can also try to see if you can specify the related key if you make the API call manually

Thanks a lot. I could create multiple relationships (two one-way relationships: one-to-one and one-to-many and one two-way relationship). Theoretically this should work. But I will test the code and report the outcome.

I could also create multiple two-way one-to-one relationships for each of the contained address fields, namely, permAddr, localAddr and commAddr. However, I am still unable to put it to work. When I try to save Contact record, I am getting 'Server error'. Unable to find whats wrong as the JSON provided for Contact seems to be correct. (I am providing data as a nested JSON, without ids for the contained fields). The children address documents are created but the main contact document is not created.
Recommended threads
- Still an issue? On user deletion, target...
This has been mentioned here: https://discord.com/channels/564160730845151244/1295830646039515146 and as a Github issue here: https://github.com/appwrite/appwri...
- Appwrite database is rounding int values
Hi, i just noticed that appwrite is rounding the value 608542412536545279 to 608542412536545300 in my int array. It seems to somewhat relate to this github iss...
- Document attribute stuck on processing f...
