Can not have edge link have the same model for _from and _to
Have a model like this
schema.type('edge', { from: 'Task', to: ['Task'] })
Then when using let plan = Plan.link( { Task: "2320844", Task: "2273357" } )
Get Error message, Error: Missing required "_to" for link
the reason being, Object can only have one unique property.
Noted:
This feature is necessary, for example, a Task is an parent of a Task, or a Task is following another Task.
Please check it. This is the closest to a real example
https://github.com/roboncode/orango/blob/master/examples/snippets/link.js
Hi aguilera51284,
Thanks, I think I understand the example case, the issue I have is when my edge have the same model for _from and _to.
which could be a meaningful use case, such as Person Know Person, or Task is a Parent of Task
The problem is for this case, I passed the _from and _to in a form of object, as an example let plan = Plan.link( { Task: "2320844", Task: "2273357" } ) then this object { Task: "2320844", Task: "2273357" }, has 2 same property with the same name "Task" during run time, it result as {Task: "2273357" ) which trigger this bug
Please let me know if explained it correctly