WITH

Piped queries

The WITH clause allows queries to be chained together, piping the results from one to be used as starting points or criteria in the next.

Reference: WITH manual page
Related: :help MATCH :help RETURN :help Cypher
MATCH (director:Person)-[:DIRECTED]->(movie)
WITH director, count(movie) as directed ORDER BY directed DESC LIMIT 1
  MATCH (hopeful:Person)-[:ACTED_IN]->(movie)
  WITH director, hopeful, count(movie) as appearances ORDER BY appearances LIMIT 1
    MATCH p=(director)-[*..4]-(hopeful)
  RETURN p
Find a path from a hopeful actor to Hollywood's most prolific director.