Skip to content

Commit f0b5d74

Browse files
fix
1 parent 0f8cca3 commit f0b5d74

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

modules/ROOT/pages/queries/composed-queries/conditional-queries.adoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,13 +131,13 @@ For example, it cannot immediately succeed a `MATCH` clause.
131131
.Not allowed: using `WHEN` constructs as regular clauses
132132
[source, cypher, role=test-fail]
133133
----
134-
MATCH (n)-[:WORKS_FOR]->(m:Person)
135-
WHEN m IS NULL THEN {
136-
MERGE (n)-[:WORKS_FOR]->(f: Person {name: 'Peter', age: 36})
134+
MATCH (n)-[:WORKS_FOR]->(manager:Person)
135+
WHEN manager IS NULL THEN {
136+
MERGE (n)-[:WORKS_FOR]->(newManager: Person {name: 'Peter', age: 36})
137137
}
138138
RETURN n.name AS employees,
139139
m.name AS manager,
140-
f.name AS newManagerNode
140+
newManager.name AS newManagerNode
141141
----
142142

143143
Instead, if `WHEN` constructs are part of a larger query, they must either be placed within a subquery and/or on different sides of combined `UNION` queries.
@@ -189,7 +189,7 @@ Because only `Daniel` and `Eskil` had no outgoing `WORKS_FOR` relationships, the
189189
.Result
190190
[role="queryresult",options="header,footer",cols="2*<m"]
191191
|===
192-
| manager | employees
192+
| newManager | employees
193193
194194
| "Peter"
195195
| ["Daniel", "Eskil"]

0 commit comments

Comments
 (0)