Skip to content

Instantly share code, notes, and snippets.

View calvindavis's full-sized avatar
😐

Calvin Davis calvindavis

😐
View GitHub Profile
@calvindavis
calvindavis / cypher-toggle-relationship
Created June 27, 2013 13:38
Cypher query for toggling a relationship between two nodes.
START calvin = node(1), sophie = node(2)
CREATE (calvin)-[:LIKES]->(sophie)
MATCH (calvin)-[r:LIKES]->(sophie), (calvin)-[:LIKES]->(sophie)
DELETE r
RETURN count(r) = 1 AS likes