cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Passing paths to a consecutive match

Hello,
I would like to match something and I also want the paths for those matches. Then I want to do a consecutive match but I also want to preserve the last results, so I tried to pass those result elements as parameters to the next match:

MATCH path = (n)-->(e) MATCH (path), (x) RETURN path, x

However I get the error:

Neo.ClientError.Statement.SyntaxError: Type mismatch: paths defined with conflicting type Path (expected Node)

How can I modeling something like that in a Cypher query ?

1 REPLY 1

anthapu
Graph Fellow

Not sure exactly what (x) here is, but you can try this

MATCH path = (n)-->(e) 
WITH path
MATCH (x) 
RETURN path, x