tomasonjo avatar

Neo4j Cypher Guide

If you're building text2cypher tools or having LLMs generate Neo4j queries, this guide keeps you out of trouble with deprecated syntax. It covers the critical stuff like why id() is gone (use elementId() instead), how to handle null values when sorting (always filter them), and when to reach for modern patterns like Quantified Path Patterns for complex traversals. The checklist format makes it easy to validate generated queries before they hit production. Most valuable if you're migrating from older Neo4j versions or need to teach an LLM the difference between legacy pattern expressions and modern COLLECT subqueries. The sorting gotchas alone will save you debugging time.

skills.sh installs
155
GitHub stars
1.6K
last updated
Jun 3, 2026

Install

$ npx -y skills add tomasonjo/blogs --skill neo4j-cypher-guide --agent claude-code

Installs into .claude/skills of the current project.

Files

Neo4j Modern Cypher Query Guide

This skill helps generate Neo4j Cypher read queries using modern syntax patterns and avoiding deprecated features. It focuses on efficient query patterns for graph traversal and data retrieval.

Quick Compatibility Check

When generating Cypher queries, immediately avoid these REMOVED features:

  • ❌ id() function → Use elementId()
  • ❌ Implicit grouping keys → Use explicit WITH clauses
  • ❌ Pattern expressions for lists → Use pattern comprehension or COLLECT subqueries
  • ❌ Repeated relationship variables → Use unique variable names
  • ❌ Automatic list to boolean coercion → Use explicit checks

Core Principles for Query Generation

  1. Use modern syntax patterns - QPP for complex traversals, CALL subqueries for complex reads
  2. Optimize during traversal - Filter early within patterns, not after expansion
  3. Always filter nulls when sorting - Add IS NOT NULL checks for sorted properties
  4. Explicit is better than implicit - Always use explicit grouping and type checking

Critical Sorting Rule

Sponsors

Details

Repository
github.com/tomasonjo/blogs
Categories
Documentation, Databases
First seen
Jun 3, 2026
1rohitg00 avatarwiki-research-looprohitg00/pro-workflowAuto-grow a pro-workflow wiki by running a budget-capped BFS research loop over pluggable source fetchers (web, arXiv, GitHub). Each iteration pops a seed from 154skills.sh installs
2rohitg00 avatarwiki-viewerrohitg00/pro-workflowRender a self-contained HTML viewer for a pro-workflow wiki. Pages, sources, claims, seed queue, page-link graph and full-text search all in one file. No extern153skills.sh installs
3hoodini avatarcopilot-docshoodini/ai-agents-skillsConfigure GitHub Copilot with custom instructions. Use when setting up .github/copilot-instructions.md, customizing Copilot behavior, or creating repository-spe147skills.sh installs
4jamesgray007 avatarwriting-x-postsjamesgray007/hoai-courseCreate engaging X (Twitter) posts and threads that drive engagement and grow audience. Use this skill when asked to write X/Twitter content, create threads, cra140skills.sh installs
5borghei avatarquality-documentation-managerborghei/claude-skillsDocument control for medical device QMS, covering numbering, version control, change management, and 21 CFR Part 11 compliance. Use for document control procedu136skills.sh installs
6jabrena avatar113-java-maven-documentationjabrena/cursor-rules-java113 java maven documentation125skills.sh installs