I'm new to Cypher and NEO4J in general, but I can't seem to google my way out of this one.
I have a graph like this:
What I want is to discover every path to the Teal node (ID 75) with one of the orange nodes as a starting point. All edges on orange nodes are outgoing with type "LINKED_BY_USER". So in this specific scenario, for node 73 I would want to have the following paths returned
- 73 > 72 > 71 > 75
- 73 > 72 > 76 > 75
- 73 > 72 > 76 > 77 > 78 > 75
With this query: MATCH (e:Orange {Id: "73"})-[:LINKED_BY_USER*]-(e2:Teal) RETURN e2, count(*)
I get a count of 5, which I don't understand. Is it finding paths where it goes through 75 and then circles back? If so, shouldn't I get way more than 5 or is there some sort of cycle detection that stops when it detects a cycle? I guess in that case what I would need is a way to stop looking for paths as soon as the a goal node of type Teal is in the path? How would I do that? Thanks in advance.