-
-
Save peterneubauer/6363731 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
= One Node Kant | |
//console | |
query to create one node with one property | |
[source,cypher] | |
---- | |
CREATE (n {name : 'Immanuel'}) | |
---- | |
//table | |
query to add property to node | |
[source,cypher] | |
---- | |
START n=node(*) | |
WHERE n.name = 'Immanuel' | |
SET n.lastName = 'Kant' | |
RETURN n as kant | |
---- | |
//table | |
query to add and remove property from node | |
[source,cypher] | |
---- | |
START n=node(*) | |
WHERE n.name = 'Immanuel' | |
SET n.firstName = 'Immanuel' | |
REMOVE n.name | |
RETURN n as kant | |
---- | |
//table | |
query to filter with AND HAS and RegEx | |
[source,cypher] | |
---- | |
START n=node(*) | |
WHERE | |
HAS(n.firstName) // test existence | |
AND n.firstName = 'Immanuel' // test not Null and equal | |
AND n.lastName =~ '^K.*' // RegEx | |
AND n.firstName =~ '(?i)immANuEl' // case insensitive RegEx | |
AND n.lastName IN [ 'Kant', 'Kan', 'NoIKant', 'YesIKan' ] // in list | |
RETURN n as kant | |
---- | |
//table | |
query to delete node | |
[source,cypher] | |
---- | |
START n=node(*) | |
WHERE n.firstName = 'Immanuel' | |
DELETE n | |
---- | |
//table |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment