Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A way of querying based on relationship attributes. #361

Open
xndbogdan opened this issue May 27, 2022 · 1 comment
Open

A way of querying based on relationship attributes. #361

xndbogdan opened this issue May 27, 2022 · 1 comment
Labels

Comments

@xndbogdan
Copy link

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!

@Mulkave
Copy link
Member

Mulkave commented Jun 1, 2022

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants