Neo4j
Installation
SKILL.md
MERGE Trap
MERGEmatches the FULL pattern—MERGE (a)-[:KNOWS]->(b)creates duplicates if relationship missing- Safe upsert: merge nodes separately, then merge relationship
- Use
ON CREATE SETandON MATCH SETfor conditional properties—without these, nothing updates on match - For simple node upsert:
MERGE (n:User {id: $id})with unique constraint on id
Indexes
- No index on property = full label scan—always index properties used in WHERE
- Unique constraint auto-creates index—prefer constraint over plain index when applicable
- Check plan with
EXPLAINbefore production—look for "NodeByLabelScan" without filter pushdown - Text search needs full-text index:
CREATE FULLTEXT INDEX FOR (n:Post) ON EACH [n.title, n.body]