You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/ROOT/pages/functions/predicate.adoc
+73Lines changed: 73 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,6 +54,7 @@ CREATE
54
54
.Considerations
55
55
|===
56
56
| `null` is returned if the `list` is `null` or if the `predicate` evaluates to `null` for at least one element and does not evaluate to false for any other element.
57
+
| `all()` returns `true` if `list` is empty because there are no elements to falsify the `predicate`.
| `null` is returned if the `list` is `null` or if the `predicate` evaluates to `null` for at least one element and does not evaluate to false for any other element.
127
+
| `any()` returns `false` if `list` is empty because there are no elements to satisfy the `predicate`.
109
128
|===
110
129
111
130
.+any()+
@@ -135,6 +154,24 @@ The query returns the `Person` nodes with the `nationality` property value `Amer
135
154
136
155
|===
137
156
157
+
158
+
.`any()` on an empty `LIST`
159
+
[source, cypher]
160
+
----
161
+
WITH [] as emptyList
162
+
RETURN any(i IN emptyList WHERE true) as anyTrue, any(i IN emptyList WHERE false) as anyFalse
@@ -312,6 +349,7 @@ xref:syntax/operators.adoc#cypher-comparison[`IS NULL` or `IS NOT NULL`] should
312
349
.Considerations
313
350
|===
314
351
| `null` is returned if the `list` is `null`, or if the `predicate` evaluates to `null` for at least one element and does not evaluate to `true` for any other element.
352
+
| `none()` returns `true` if `list` is empty because there are no elements to violate the `predicate`.
| `null` is returned if the `list` is `null`, or if the `predicate` evaluates to `null` for at least one element and does not evaluate to `true` for any other element.
423
+
| `single()` returns `false` if `list` is empty because there is not exactly one element satisfying the `predicate`.
368
424
|===
369
425
370
426
.+single()+
@@ -394,4 +450,21 @@ In every returned path there is exactly one node which has the `nationality` pro
394
450
395
451
|===
396
452
453
+
.`single()` on an empty `LIST`
454
+
[source, cypher]
455
+
----
456
+
WITH [] as emptyList
457
+
RETURN single(i IN emptyList WHERE true) as singleTrue, single(i IN emptyList WHERE false) as singleFalse
0 commit comments