Learn more on this page in the Neo4j docs.
Created with help from @DaniSancas's Neo4j Cypher cheatsheet.
View all nodes
MATCH (n) RETURN N
Delete all nodes (and return how many were deleted)
MATCH (n) DETACH DELETE (n) RETURN COUNT(n)
Find all Resource nodes
MATCH (r: Resource) RETURN r
Find Concept nodes with the title "Object-Oriented Programming"
MATCH (target:Concept {title: "Object-Oriented Programming"}) RETURN target
Find Concept nodes with the title "Object-Oriented Programming" AND all of their child nodes
MATCH (target:Concept {title: "Object-Oriented Programming"})-[relations]-(children) RETURN target, relations, children
Recursively find child Concept nodes with a
TEACHES
relation to the Conceptc0
MATCH (this: Concept {id: "c0"})-[:TEACHES *1..]->(c:Concept) return this, c
Find every Module which TEACHES a Lecture, then return those modules and lectures.
MATCH (m: Module)-[:TEACHES]->(lec: Lecture) RETURN m, lec
Find every Module which TEACHES a Lecture... and then find every Concept which is taught by one of those lectures... then return those modules, lectures, and concepts.
MATCH (m: Module)-[:TEACHES]->(lec: Lecture) MATCH(lec)-[:TEACHES]->(c:Concept) RETURN m, lec, c