Skip to content

Commit baa6008

Browse files
query fix
1 parent 07b8dd5 commit baa6008

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,15 +172,15 @@ In this example, `WHEN` is used to execute a xref:subqueries/call-subquery.adoc[
172172
[source, cypher]
173173
----
174174
MATCH (n:Person)
175-
OPTIONAL MATCH (n)-[:WORKS_FOR]->(m:Person)
175+
OPTIONAL MATCH (n)-[:WORKS_FOR]->(manager:Person)
176176
CALL (*) {
177-
WHEN m IS NULL THEN {
178-
MERGE (f: Person {name: 'Peter', age: 36})
179-
MERGE (n)-[:WORKS_FOR]->(f)
180-
RETURN f, n.name AS employee
177+
WHEN manager IS NULL THEN {
178+
MERGE (newManager: Person {name: 'Peter', age: 36})
179+
MERGE (n)-[:WORKS_FOR]->(newManager)
180+
RETURN newManager, n.name AS employee
181181
}
182182
}
183-
RETURN f.name AS manager,
183+
RETURN newManager.name AS newManager,
184184
collect(employee) AS employees
185185
----
186186

0 commit comments

Comments
 (0)