Closed Ajaxsoap closed 8 years ago
Hi @nicolaslopezj ,
I've seen this issue from @amejias101 here
This is somehow a supplementary to the comment above. I have issues on relationship attribute, my schema on my other collection hasMany children, when I relate this to other collection, only the first child from all documents are available, ideally, it should be all the children from the same document are available.
I think we should find a way to solve this issue, as orion is getting more popular.
My idea for this is to have a filter per document(_id), if the dev wants only the fields from one document.
if (doc._id) then return only the fields on that document, be an array or a single field, if (doc._all) then return from all documents.
Use case
Insurance system like my current project, I have a personal info collection. InsuredName
, Address
, Contact
, Children
, Spouse
and Parent
.
On the my claims collection, from the personal info collection, I have a hasOne field Name
, then hasMany
dependent fields Children
and Parent
and so on.
The ideal situation is, when I create a claim, i will select one InsuredName
then select dependent Children
either one or many on the same document as InsuredName
.
My current situation, when i create a claim, I will select InsuredName
then dependent Children
, but the problem is all the first child from other documents are available. How do we fixed this issue.
Thanks.
I already solve my issue by creating a reactive variable, unfortunately, the relationship attribute is no use for my kind of use case.
Hi @nicolaslopezj ,
How do I filter the hasMany and hasOne to the related document?
use case: I have a form with a name children, parent and sibling fields, this fields are all relationship from other collections, the requirement is if I select
name(hasOne)
then the other fieldschildren
,parents
andsiblings
will appear only based on the sibling name field. If I select name="John Doe", the children should be John Doe children and so on.I've managed to filter it by user profile like i did on this issue.
Thanks,