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/clauses/limit.adoc
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -166,12 +166,14 @@ Properties set: 1
166
166
`LIMIT` can be used as a standalone clause, or in conjunction with xref:clauses/order-by.adoc[`ORDER BY`] or xref:clauses/skip.adoc[`SKIP`]/xref:clauses/skip.adoc#offset-synonym[`OFFSET`].
The below query uses a xref:subqueries/call-subquery.adoc#variable-scope-clause[variable scope clause] (introduced in Neo4j 5.23) to import variables into the `CALL` subquery.
712
+
The query below uses a xref:subqueries/call-subquery.adoc#variable-scope-clause[variable scope clause] (introduced in Neo4j 5.23) to import variables into the `CALL` subquery.
709
713
If you are using an older version of Neo4j, use an xref:subqueries/call-subquery.adoc#importing-with[importing `WITH` clause] instead.
710
714
711
715
.Query
716
+
// tag::clauses_load_csv_transactions[]
712
717
[source, cypher]
713
718
----
714
719
LOAD CSV WITH HEADERS FROM 'https://data.neo4j.com/importing-cypher/persons.csv' AS row
@@ -717,6 +722,7 @@ CALL (row) {
717
722
SET p.name = row.name, p.born = row.born
718
723
} IN TRANSACTIONS OF 200 ROWS
719
724
----
725
+
// end::clauses_load_csv_transactions[]
720
726
721
727
.Result
722
728
[source, role="queryresult"]
@@ -751,11 +757,13 @@ A common use case for this function is to generate sequential unique IDs for CSV
Copy file name to clipboardExpand all lines: modules/ROOT/pages/clauses/unwind.adoc
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,11 +29,13 @@ The `UNWIND` clause requires you to specify a new name for the inner values.
29
29
We want to transform the literal list into rows named `x` and return them.
30
30
31
31
.Query
32
+
// tag::clauses_unwind_list[]
32
33
[source, cypher]
33
34
----
34
35
UNWIND [1, 2, 3, null] AS x
35
36
RETURN x, 'val' AS y
36
37
----
38
+
// end::clauses_unwind_list[]
37
39
38
40
Each value of the original list -- including `null` -- is returned as an individual row.
39
41
@@ -109,13 +111,15 @@ The two lists -- _a_ and _b_ -- are concatenated to form a new list, which is th
109
111
Multiple `UNWIND` clauses can be chained to unwind nested list elements.
110
112
111
113
.Query
114
+
// tag::clauses_unwind_nested_list[]
112
115
[source, cypher]
113
116
----
114
117
WITH [[1, 2], [3, 4], 5] AS nested
115
118
UNWIND nested AS x
116
119
UNWIND x AS y
117
120
RETURN y
118
121
----
122
+
// end::clauses_unwind_nested_list[]
119
123
120
124
The first `UNWIND` results in three rows for `x`, each of which contains an element of the original list (two of which are also lists); namely, `[1, 2]`, `[3, 4]`, and `5`.
121
125
The second `UNWIND` then operates on each of these rows in turn, resulting in five rows for `y`.
@@ -212,13 +216,15 @@ Create a number of nodes and relationships from a parameter-list without using `
212
216
----
213
217
214
218
.Query
219
+
// tag::clauses_unwind_create_nodes[]
215
220
[source, cypher]
216
221
----
217
222
UNWIND $events AS event
218
223
MERGE (y:Year {year: event.year})
219
224
MERGE (y)<-[:IN]-(e:Event {id: event.id})
220
225
RETURN e.id AS x ORDER BY x
221
226
----
227
+
// end::clauses_unwind_create_nodes[]
222
228
223
229
Each value of the original list is unwound and passed through `MERGE` to find or create the nodes and relationships.
0 commit comments