You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
Cypher is Neo4j's declarative query language, designed to be visual and intuitive. Cypher uses ASCII-art patterns to describe graph structures, making queries readable even without deep database expertise.
Nodes are represented with parentheses:
() // Anonymous node
(p) // Node bound to variable p
(:Person) // Node with label Person
(p:Person) // Node with label, bound to variable p
(p:Person {name: "Alice"}) // Node with label and property filter
Relationships are represented with square brackets and arrows:
--> // Anonymous directed relationship
-[r]-> // Relationship bound to variable r
-[:PURCHASED]-> // Relationship with type PURCHASED
-[r:PURCHASED]-> // Relationship with type, bound to variable
-[r:PURCHASED {date: "2024-01-15"}]-> // With property filter
Combine nodes and relationships into a pattern:
(alice:Person {name: "Alice"})-[:PURCHASED]->(product:Product)
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.