Need little help with Cypher. My Cypher is,
MATCH p=(user)-[r1:roles]->(role1:`Role`)-[:include*1..]->(role2:`Role`)
RETURN collect(tail(relationships(p))), collect(role2)
For a path where include
relation is more than 1 level deep, it gives all include
relations for that path as array with corresponding role2
. Where as I want just the last relationship and the respective node.
Thanks.