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 n

Examples#

Filter after aggregation#

MATCH (n:Person) WITH n WHERE n.age > 25 RETURN n.name

Multi-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 DESC

See Also#

Try it
Open ↗
Loading engine…