I am trying to figure out how to write a Cypher query for Neo4J. I have a linked list of nodes like this:
n-[FIRST_NODE]->n-[NEXT_NODE]->n-[NEXT_NODE]->.....
The FIRST_NODE relationship has a property that says how deep in the list we should retrieve nodes. I want to retrieve a list of nodes possibly skipping one based on a property in n and retrieve x amount of nodes where x is the depth we should traverse in the list. Does this make sense?
I have come up with the below query but it doesn't work!
MATCH (x)-[firstIssue:FIRST_NODE]->(y:Type1)
MATCH (z)-[:NEXT_NODE*1..{firstIssue.Count}]->(a:Type1)
RETURN x,y,z,a
Any help would be apprectiated!.