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/expressions/predicates/list-operators.adoc
+7-9Lines changed: 7 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,10 +7,9 @@ Cypher contains the following list operator:
7
7
8
8
* Membership: `IN`
9
9
10
-
11
10
For additional list predicates, see:
12
11
13
-
* The following quantifier predicates: xref:functions/predicate.adoc#functions-all[`all()`], xref:functions/predicate.adoc#functions-any[`any()`], xref:functions/predicate.adoc#functions-none[`none()`], and xref:functions/predicate.adoc#functions-single[`single()`].
12
+
* The following predicate functions: xref:functions/predicate.adoc#functions-all[`all()`], xref:functions/predicate.adoc#functions-any[`any()`], xref:functions/predicate.adoc#functions-none[`none()`], and xref:functions/predicate.adoc#functions-single[`single()`].
14
13
* The xref:functions/predicate.adoc#functions-isempty[`isEmpty()`] function.
15
14
16
15
[[example-graph]]
@@ -128,7 +127,7 @@ RETURN NULL IN [1, 2, NULL] AS nullInList, 123 IN NULL AS valueInNull
128
127
2+d|Rows: 1
129
128
|===
130
129
131
-
To check if `NULL` is a member of a `LIST`, use a xref:functions/predicate.adoc[predicate function] such as xref:functions/predicate.adoc#functions-any[`any()`]:
130
+
To check if `NULL` is a member of a `LIST`, use the xref:functions/predicate.adoc#functions-any[`any()`] function:
132
131
133
132
.Checking if `NULL` is a member of a `LIST`
134
133
[source, cypher]
@@ -150,10 +149,9 @@ RETURN any(x IN [1, 2, NULL] WHERE x IS NULL) AS containsNull
150
149
== Nested lists
151
150
152
151
When used with nested `LIST` values, the `IN` operator evaluates whether a `LIST` is an exact match to any of the nested `LIST` values that are part of an outer `LIST`.
153
-
The operator checks for exact matches, meaning that it will only return `TRUE` when the entire nested `LIST` matches one of the `LIST` values within the outer `LIST`.
154
-
Partial matches or individual elements within a nested `LIST` will return `FALSE`.
152
+
Partial matches of individual elements within a nested `LIST` will return `FALSE`.
155
153
156
-
.Nested `LIST` values
154
+
.Checking for membership in nested `LIST` values
157
155
=====
158
156
159
157
.Checking if a `LIST` is in a `LIST` of nested `LIST` values
@@ -211,10 +209,10 @@ RETURN [1] IN [[1, 2], [3, 4]] AS listInNestedTest
211
209
== List subsets
212
210
213
211
A subset check verifies if all elements of one `LIST` exist in another.
214
-
Set checks ignores `LIST` order and groupings, and does not require exact sublist matches.
212
+
In other words, it ignores `LIST` order and groupings.
215
213
The xref:functions/predicate.adoc#functions-all[`all()`] function is used to ensure that every element in the first `LIST` is found in the second `LIST`.
216
214
217
-
.Sublist check
215
+
.Subset check
218
216
[source, cypher]
219
217
----
220
218
WITH [1,3,4] AS sub, [3,5,1,7,6,2,8,4] AS list
@@ -233,7 +231,7 @@ This returns `TRUE` because all elements in `sub` are part of `list`.
0 commit comments