WITH
Chain queries into pipelines. The output of one stage becomes the input of the next.
Syntax#
MATCH (n:Label) WITH n WHERE predicate RETURN nExamples#
Filter after aggregation#
MATCH (n:Person) WITH n WHERE n.age > 25 RETURN n.nameMulti-stage pipeline#
MATCH (n:Person)-[:KNOWS]->(friend)
WITH n, count(friend) AS friend_count
WHERE friend_count > 5
RETURN n.name, friend_count ORDER BY friend_count DESCSee Also#
Try it
Open ↗⌘↵ to run
Loading engine…