Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
09-19-2020 08:22 AM
Hello. I have a db where each node is a Person. Persons are connected to each other by RESPONSIBLE_OF tag. Let's say A is responsible of B and C. But B is also responsible of D. I need a query that will return me the people working under A who are B, C, D (D is not directly under A but he/she is under B who is under A).
It might look like a simple query but I'm new to graph db and I really couldn't find it.
MATCH p = (a {userId: 1})-[:RESPONSIBLE_OF]->(b) RETURN b
I found this query that returns me B and C but as I stated I need D as well. Of course there is no depth limit in this search. Say if there is person E working under D as well then I want query to return B,C,D and E.
Solved! Go to Solution.
09-19-2020 08:31 AM
Hello @raepheles and welcome to the Neo4j community
MATCH p = (a {userId: 1})-[:RESPONSIBLE_OF*]->(b) RETURN b
Regards,
Cobra
09-19-2020 08:31 AM
Hello @raepheles and welcome to the Neo4j community
MATCH p = (a {userId: 1})-[:RESPONSIBLE_OF*]->(b) RETURN b
Regards,
Cobra
All the sessions of the conference are now available online