Vinelab/NeoEloquent

A way of querying based on relationship attributes.

Opened this issue · 1 comments

Hi. I've checked the source code and documentation for a solution to my issue but was unable to.
I am working on an app that allow users to have relationships between them.
They can be friends, but also relatives.
I'm managing this by having a "type" attribute on the relationship.
Is there any way, for example, to query a certain Person A and fetch all of their sons/children, or only their friends?

Thank you!

Unfortunately this is not possible in the current version, and may be worked in the future. For the time being, the only way we work this out is by having two different relationship types (a method per relationship type between the models, or the model and itself). e.g.

(u1)-[:FRIENDS_WITH]->(u2) also have another relationship if both are needed (u1)-[:RELATED_TO]->(2) or (u1)-[:RELATIVE_OF]->(u2)