I'm pretty new to neo4j and I managed to create nodes and relationships between them. But now I'm trying to get the last nodes. Given I've the following graph:
Each node references the previous day. Now I want start at "Day 1" to get the last node ("Day 4") to determine it's date. How can I do this? After I read https://neo4j.com/docs/cypher-manual/current/functions/scalar/#functions-endnode I tried MATCH mypath = (b:Days)<-[prevDay]-(endnode) RETURN endNode(prevDay) AS lastDay
. Unfortunately this query returns me Day 1, Day 2 and Day 3. The last day ("Day 4") is not returned. So how can I get "Day 4" only?