I have 2 collection skills and ProductContent. ProductContent have one to many relationship attribute connected with skills collections and skills collection have one to many relationship attribute connected with ProductContent collection. I want to store in ProductContent (skills=>collection of skills id's) and in skills (ProductContent=>collections of project id's) but i am getting server error and error type is unknown.
As what I observed, you have One way attribute relationship in each collection.
Skill collections has One way attribute relationship of the ProductContent, and Similar to the ProductContent collection. I recommend use the Two way
reason?
That could make effecient way
reason maybe it will create a new instance of attributes.
But base in your explanation that could make better
my code is correct ?
can I see the sample value of skills in your code
and can I ask for screenshot of what is the error response of this issue
you can look the error response by using Insepct > Network Tab
in technology, i am getting as [{id:"id1",technology:"reactjs"},{id:"id2",technology:"python}] and that i am including in skills
[{id:"id1",technology:"reactjs"},{id:"id2",technology:"python}], if this is the sample value of skills in creating document within ProductContent. I aware that you include the id but seems your skills collection does not have id attribute. You can remove this one.
so i should first remove id's from skills then insert it into the function
?
if your code has id properties then yes. But if you dont want to delete it then
do this
const skillsMutate = skills.map(item => ({ technology: item.technology }));
{
...
skills: skillsMutate
}
It will only extract the technology property
i am using many to many for 2 way, but it storing redundant data
hmmmm, if I recall. The Business logic of your collection is that "The Product Content can contain many skills. While the skills only belong to one Product Content". If that the case you should set up into One to many.
If your previous solved you can edit this post into [SOLVED] if you have new issue please create new one.
no ProductContent can contain many skills and skills contain many ProductContent
[solved]Relationship attribute between collections
Recommended threads
- CORS errors in Obsidian custom plugin
Hi, anyone here familiar with obsidian community plugins? In short: it's a local first note app which supports writing your own add-ons / plugin But I keep get...
- > AppwriteException: The requested servi...
When trying to read or write from my database I get the following error: > AppwriteException: The requested service is disabled. You can enable the service from...
- Courtesy limit reset for non-profit migr...
Hi Team! I'm the architect for a 501(c)(3) non-profit project (Aaria's Blue Elephant) and we just hit our Free plan Database Read limit (currently at 164%). Th...