-
Notifications
You must be signed in to change notification settings - Fork 11
/
cypher.snippets.json
111 lines (111 loc) · 2.4 KB
/
cypher.snippets.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
{
"MATCH": {
"prefix": "match",
"body": [
"MATCH (${1:n}:${2:Label})"
],
"description": "Match a Node with a label"
},
"MERGE": {
"prefix": "merge",
"body": [
"MERGE (${1:n}:${2:Label} { ${3:id}: ${4:\\$${3}} })",
"${5:SET ${1}.${6:prop} = $${6}}"
],
"description": "Match a Node with a label"
},
"CREATE node": {
"prefix": "createnode",
"body": [
"CREATE (${1:n}:${2:Label} { ${3:id}: ${4:\\$${3}} })",
""
],
"description": "Create a Node with a label"
},
"CREATE relationship": {
"prefix": "createrelationship",
"body": [
"CREATE (${1:n})-[${2:r}:${3:TYPE}${4: {${5:key: \\$value}\\}}]->(${6:m})",
""
],
"description": "Create a relationship between two nodes"
},
"Node": {
"prefix": "node",
"body": [
"(${1:n}:${2:Label})"
],
"description": "Add a node to a pattern"
},
"Outgoing Relationship": {
"prefix": "out",
"body": [
"-[${1:r}:${2:TYPE}]->"
],
"description": "Add an outgoing relationship to a pattern"
},
"Incoming Relationship": {
"prefix": "in",
"body": [
"<-[${1:r}:${2:TYPE}]-"
],
"description": "Add an incoming relationship to a pattern"
},
"WITH": {
"prefix": "with",
"body": [
"WITH ${1:*}",
""
],
"description": "Add flow control step using WITH"
},
"CASE": {
"prefix": "case",
"body": "CASE WHEN ${1:true} THEN ${2:[1]} ELSE ${3:[]} END"
},
"FOREACH": {
"prefix": "foreach",
"body": "FOREACH ( ${1:id} IN ${2:[1,2,3]} | ${3:MERGE (p:Person {id: ${1}\\}} )"
},
"UNWIND": {
"prefix": "unwind",
"body": [
"UNWIND ${1:$data} AS ${2:row}",
""
],
"description": "Unwind a list of values"
},
"Return": {
"prefix": "return",
"body": [
"RETURN ${1:*}",
""
],
"description": "Return something"
},
"Delete": {
"prefix": "delete",
"body": [
"DELETE ${1:n}",
""
],
"description": "Delete something"
},
"Set": {
"prefix": "set",
"body": [
"SET ${1:n}.${2:key} = ${3:$$value}"
],
"description": "Set a property"
},
"Create Constraint": {
"prefix": "createuniqueconstraint",
"body": "CREATE CONSTRAINT${1: IF NOT EXISTS} FOR (${2:n}:${3:Label}) REQUIRE (${2}.${4:id}) IS UNIQUE;\n",
"description": "Create a constraint"
},
"Create Node Key": {
"prefix": "createnodekeyconstraint",
"body": "CREATE CONSTRAINT ${1:IF NOT EXISTS} FOR (${2:n}:${3:Label}) REQUIRE (${2}.${4:id}, ${2}.${5:id}) IS NODE KEY;\n",
"description": "Create a constraint"
}
}