Neo4j Cypher Cheat Sheet: Essential Queries at Your Fingertips

23.08.2025

Neo4j Cypher Cheat Sheet is a valuable resource for developers working with Neo4j databases. It provides a quick reference guide for essential queries that can help you manipulate and retrieve data efficiently. Whether you are new to Cypher or a seasoned pro, having these queries at your fingertips can save you time and effort during development.

Configuration - Neo4j JDBC Driver manual

Basic Queries

  • CREATE – Create nodes and relationships in the graph.
  • MATCH – Retrieve nodes and relationships based on specified patterns.
  • RETURN – Specify what data to retrieve from the graph.
  • DELETE – Delete nodes and relationships from the graph.

Filtering Queries

  • WHERE – Filter results based on specified conditions.
  • ORDER BY – Sort results in ascending or descending order.
  • LIMIT – Limit the number of results returned.

Pattern Matching

  • Node Matching – Match nodes based on labels and properties.
  • Relationship Matching – Match relationships based on types and properties.
  • Pattern Combinations – Combine node and relationship patterns for complex queries.

Aggregation Queries

  • RETURN COUNT() – Count the number of results returned by a query.
  • RETURN AVG() – Calculate the average value of a property in the results.
  • RETURN SUM() – Calculate the sum of a property in the results.

Working with Paths

  • RETURN PATH – Retrieve the paths between nodes in the graph.
  • RETURN NODES – Retrieve only the nodes in the paths.
  • RETURN RELATIONSHIPS – Retrieve only the relationships in the paths.

Conditional Queries

  • CASE – Perform conditional operations based on specified conditions.
  • FOREACH – Perform operations on each element in a list.
  • UNWIND – Expand lists into separate rows.

By familiarizing yourself with these essential queries and keeping the Neo4j Cypher Cheat Sheet handy, you can streamline your development process and make the most out of your Neo4j database. Whether you are building a new application or optimizing an existing one, Cypher queries are key to unlocking the full potential of your graph data.

Do you like the article?

Yan Hadzhyisky

fullstack PHP+JS+REACT developer