pattern matching
Finding every part of the graph that fits a given pattern.
Example
Tom Hanks acted in two of these films and Tim Allen in one.
cypher
MATCH path = (:Person)-[:ACTED_IN]->(:Movie)
RETURN pathThe pattern fits three times: Tom Hanks with each of his two films, and Tim Allen with Toy Story. Each fit comes back as a row of its own.
Lessons that use this term
The lesson and course links below open in a new tab.
4 lessons use this term. Results are ordered by term density.
Context Graphs: Agent Memory with Neo4j1 mention
- Why Graphs for Agent MemoryIntroduction to Agent Memorywhat) Temporal reasoning (who owned this account in Q3 2025?) Structural pattern matching across node1 mention
Path Finding with GDS1 mention
- Shortest Paths with CypherFinding Shortest Paths using Cypheroutput is a Path object — the same shape you already know from regular pattern matching1 mention
Neo4j Management, Optimization, and Refactoring Workshop1 mention
- IndexesQuery Performancenodes are the starting points for graph pattern matching in Cypher1 mention
Introduction to Neo4j & GraphQL1 mention
- The @cypher DirectiveConfigure The APIyou all the power of Cypher, with the ability to express complex traversals, pattern matching, even leveraging Cypher procedures like1 mention