Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
12-26-2019 11:23 PM
Hi
I am trying to get the distinct nodes and relationships from the following Cypher query:
MATCH (p:Person {name :'John James Smith'})
CALL apoc.path.expand(p,'former_member|current_member','+team|person',0,3)
YIELD path as pp
RETURN pp;
I have had some success in getting the node details by using UNWIND:
MATCH (p:Person {name :'John James Smith'})
CALL apoc.path.expand(p,'former_member|current_member','+team|person',0,3)
yield path as pp
UNWIND nodes(pp) as n
RETURN n.name as PName, n.team_nickname as NickName
but I'm not able to get anything about the relationships.
Any help or insights is greatly appreciated.
Cheers
12-27-2019 05:18 AM
Can you call UNWIND relationships(pp) to get the relationships in the paths?
Elaine
All the sessions of the conference are now available online