This question is dedicated to the next question here
I have a graph that has a circular linked list. ( see here for an example ). Each node in a linked list points to a user. When querying a list, I have to use the path operator since the list is round and I don't want to retrieve nodes starting with u: USER node. To get the nodes of interest, my query looks like this:
MATCH path=(nl:NODELINK { linkId:'cc' })-[:LINK*]->(u:USER)
RETURN nodes(path)
As soon as I get back to the path, I would like to do further matching with the nodes in this path (NODELINK), something like the following:
MATCH path=(nl:NODELINK { linkId:'cc' })-[:LINK*]->(u:USER)
WITH nodes(path) AS nodeLinks
MATCH nodeLinks-[:PERSONLINK]->persons
RETURN persons
but if I try to get an error:
Error: Type mismatch: nodeLinks already defined with conflicting type Collection<Node> (expected Node) (line 3, column 7)
"MATCH nodeLinks-[:PERSONLINK]->persons"
How to unpack nodes of type NODELINK from a path to make further MATCH queries against them?