The simple question is: How to calculate the maximum depth value and the maximum depth path from a node using neo4j (2.3.11) cypher?
Explanation of my scenario
I have node label called person and relationship types called supervised.
Think in a scenario: a node 1 can supervise 2, 2 can supervise 3 and 4, 4 can supervise 5 and so on.
So 1 need of:
I want to make a cypher, that receive the id, e.g. 1(personID), as parameter, and return the path [1, 2, 4, 5 ....]
And another cypher that returns the path count.
I tried that cypher (neo4j 2.3.11) for the second case, without success:
MATCH (person:Person)-[SUPERVISED*]->()
WITH person, LENGTH(SUPERVISED) AS depth
where person.personID = 'la3486551918237738'
RETURN person, depth;
Based in this solution