Skip to content

Commit b5ca1b2

Browse files
review corrections
1 parent 6baa37f commit b5ca1b2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ WHEN predicate THEN [{]
4747
[}]]
4848
----
4949

50-
The first predicate that evaluates to `true` will be executed.
50+
The first branch with a predicate that evaluates to `true` will be executed.
5151
If no `WHEN` branches are executed and an `ELSE` branch exists, it is executed.
5252
If no `WHEN` branches evaluates to `true` and no `ELSE` branch is present, no branches are executed and no rows are produced.
5353
The following examples demonstrates this logic:
@@ -57,10 +57,11 @@ The following examples demonstrates this logic:
5757
----
5858
WHEN false THEN RETURN 1 AS x
5959
WHEN true THEN RETURN 2 AS x
60+
WHEN true THEN RETURN 3 AS x
6061
ELSE RETURN 3 AS x
6162
----
6263

63-
Since the second `WHEN` branch is `true`, it will execute, while the preceding branch (which is `false`) and the succeeding `ELSE` branch will be skipped.
64+
Since the second `WHEN` branch is `true`, it will execute, while the preceding branch (which is `false`) and the succeeding `WHEN` branch (which is `true`) as well as the `ELSE` branch will be skipped.
6465

6566
.Result
6667
[role="queryresult",options="header,footer",cols="1*<m"]
@@ -78,7 +79,8 @@ WHEN true THEN {
7879
MATCH (n:Person) WHERE n.name STARTS WITH "A"
7980
RETURN n.name AS name
8081
}
81-
ELSE { MATCH (n:Person)
82+
ELSE {
83+
MATCH (n:Person)
8284
RETURN n.name AS name
8385
}
8486
----

0 commit comments

Comments
 (0)