diff --git a/modules/ROOT/pages/values-and-types/lists.adoc b/modules/ROOT/pages/values-and-types/lists.adoc index f8119f892..2db07d892 100644 --- a/modules/ROOT/pages/values-and-types/lists.adoc +++ b/modules/ROOT/pages/values-and-types/lists.adoc @@ -3,8 +3,8 @@ [[cypher-lists]] = Lists -Cypher includes comprehensive support for lists. -This section first describes lists in general, and then discusses how to use list comprehension and pattern comprehension in lists. +Cypher includes comprehensive support for lists. +This section first describes lists in general, and then discusses how to use list comprehension and pattern comprehension in lists. [NOTE] ==== @@ -56,10 +56,10 @@ For example: .Query [source, cypher] ---- +---- WITH [5,1,7] AS list RETURN list[2] ---- +---- .Result [role="queryresult",options="header,footer",cols="1*(b:Movie) WHERE b.title CONTAINS 'Matrix' | b.released] AS yea The whole predicate, including the `WHERE` keyword, is optional and may be omitted. -==== Storing lists as properties +==== Storing lists as properties -It is possible to store homogenous lists of simple values as properties. -For example, the following query creates a list from the `title` properties of the `Movie` nodes connected to `Keanu Reeves`. +It is possible to store homogenous lists of simple values as properties. +For example, the following query creates a list from the `title` properties of the `Movie` nodes connected to `Keanu Reeves`. It then sets that list as a `resume` property on `Keanu Reeves`. .Query @@ -291,8 +291,8 @@ RETURN keanu.resume |=== It is not, however, possible to store heterogeneous lists as properties. -For example, the following query, which tries to set a list including both the `title` and the `released` properties as the `resume` property of `Keanu Reeves` will fail. -This is because the `title` property values are stored as strings, while the `released` property values are stored as integers. +For example, the following query, which tries to set a list including both the `title` and the `released` properties as the `resume` property of `Keanu Reeves` will fail. +This is because the `title` property values are stored as strings, while the `released` property values are stored as integers. .Query [source, cypher, role=test-fail]