Neo4j Cypher Cheat Sheet: Essential Syntax at Your Fingertips

07.11.2025

Mastering Neo4j Cypher Cheat Sheet: Essential Syntax at Your Fingertips

Neo4j is a popular graph database management system that uses Cypher as its query language. Whether you are a beginner or an experienced user, having a cheat sheet with essential Cypher syntax can be incredibly helpful. Here is a comprehensive guide to Neo4j Cypher Cheat Sheet that you can refer to anytime:

BloodHound – Sniffing Out the Path Through Windows Domains | SANS ...

Basic Syntax

1. MATCH: This keyword is used to specify the pattern you are looking for in the graph.

2. RETURN: Use this keyword to specify what you want to retrieve from the matched pattern.

3. CREATE: Allows you to create nodes and relationships in the graph.

4. SET: Update properties on nodes and relationships.

5. DELETE: Remove nodes and relationships from the graph.

Pattern Matching

1. Node: (node)

2. Relationship: -[relationship]-

3. Direction: -> (outgoing), <- (incoming), --> (both)

4. Labels: (node:Label)

5. Properties: (node {property: value})

Filtering Results

1. WHERE: Add conditions to filter the results.

2. AND, OR, NOT: Logical operators to combine conditions.

3. IN: Check if a value is within a list.

4. STARTS WITH, ENDS WITH, CONTAINS: String matching functions.

Aggregation Functions

1. COUNT: Count the number of items.

2. MIN, MAX: Find the minimum or maximum value.

3. SUM: Calculate the sum of values.

4. AVG: Calculate the average of values.

Ordering and Limiting

1. ORDER BY: Sort the results based on a property.

2. DESC, ASC: Specify the sorting order.

3. LIMIT: Limit the number of results returned.

4. SKIP: Skip a certain number of results.

Combining Queries

1. UNION: Combine the results of two queries.

2. WITH: Pass the results of one query to another.

3. MERGE: Create or update nodes and relationships.

Advanced Techniques

1. OPTIONAL MATCH: Match patterns optionally.

2. FOREACH: Perform operations on a list.

3. CALL: Call user-defined procedures or functions.

With this Neo4j Cypher Cheat Sheet, you can quickly reference the essential syntax and commands to write powerful queries for your graph database. Keep it handy for your next Neo4j project!

Do you like the article?

Yan Hadzhyisky

fullstack PHP+JS+REACT developer