cancel
Showing results for 
Search instead for 
Did you mean: 

Neo.ClientError.Statement.SyntaxError

IchsanALi
Node Link
// Find maximum diameter of network
// maximum shortest path between two nodes
MATCH (a:Character), (b:Character) WHERE id(a) > id(b)
MATCH p=shortestPath((a)-[:INTERACTS*]-(b))
RETURN length(p) AS Length, extract(IN nodes(p) | x.name) AS Path
ORDER BY len DESC LIMIT 4
 
Neo.ClientError.Statement.SyntaxError
Extract is no longer supported. Please use list comprehension instead (line 5, column 29 (offset: 206))
"RETURN length(p) AS Length, extract(x IN nodes(p) | x.name) AS Path"
1 ACCEPTED SOLUTION

glilienfield
Ninja
Ninja

Try this:

 
match(a:Character)
match(b:Character)
where id(a) > id(b)
match p=shortestPath((a)-[:INTERACTS*]-(b))
return length(p) as Length, [x in nodes(p) | x.name] as Path
order by Length desc
limit 4

View solution in original post

2 REPLIES 2

glilienfield
Ninja
Ninja

Try this:

 
match(a:Character)
match(b:Character)
where id(a) > id(b)
match p=shortestPath((a)-[:INTERACTS*]-(b))
return length(p) as Length, [x in nodes(p) | x.name] as Path
order by Length desc
limit 4

thank you very much,
can run