I have e problem with 'filter'. It is no supported .
Query is a part from "GraphGist - Information Flow Through a Network"
Query 4
// Find all unique, simple paths from one city to another
MATCH p=(:City { name: "Tokyo" })-[:BACKBONE_TO*]-(:City { name: "Chicago" })
WHERE all(c IN nodes(p) WHERE 1=length(filter(m IN nodes(p) WHERE m=c)))
RETURN DISTINCT extract(n IN nodes(p) | n.name) AS Path, length(p) AS Length
Error:
Filter is no longer supported. Please use list comprehension instead (line 2, column 40 (offset: 118))
"WHERE all(c IN nodes(p) WHERE 1=length(filter(m IN nodes(p) WHERE m=c)))"
// Find all unique, simple paths from one city to another
MATCH p=(:City {name: "Tokyo"})-[:BACKBONE_TO*]-(:City {name: "Chicago"})
WHERE all(c IN nodes(p) WHERE 1=size([m IN nodes(p) WHERE m=c]))
RETURN DISTINCT [n IN nodes(p) | n.name] AS Path, length(p) AS Length
MATCH p=(:City { name: "Tokyo" })-[:BACKBONE_TO*]-(:City { name: "Chicago" })
WHERE all(c IN nodes(p) WHERE 1=length(RETURN[m IN nodes(p) WHERE m=c]))
RETURN DISTINCT extract(n IN nodes(p) | n.name) AS Path, length(p) AS Length
MATCH p=(:City { name: "Tokyo" })-[:BACKBONE_TO*]-(:City { name: "Chicago" })
WHERE all(c IN nodes(p) WHERE 1=size([m IN nodes(p) WHERE m=c]))
RETURN DISTINCT [n IN nodes(p) | n.name] AS Path, length(p) AS Length