Skip to content

Commit bcb9695

Browse files
Merge branch 'dev' into clarify_basic_delete
2 parents ad6b4bd + 0f8ffbd commit bcb9695

31 files changed

+477
-374
lines changed

antora.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
name: cypher-manual
22
title: Cypher Manual
3-
version: '2025'
3+
version: '5'
44
start_page: ROOT:introduction/index.adoc
55
nav:
66
- modules/ROOT/content-nav.adoc
77
asciidoc:
88
attributes:
9-
neo4j-version: '2025'
10-
neo4j-version-minor: '2025.01'
11-
neo4j-version-exact: '2025.01'
9+
neo4j-version: '2025.01'

modules/ROOT/pages/appendix/tutorials/advanced-query-tuning.adoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ Planner COST
669669
670670
Runtime PIPELINED
671671
672-
Runtime version {neo4j-version-minor}
672+
Runtime version {neo4j-version}
673673
674674
Batch size 128
675675
@@ -711,7 +711,7 @@ Planner COST
711711
712712
Runtime PIPELINED
713713
714-
Runtime version {neo4j-version-minor}
714+
Runtime version {neo4j-version}
715715
716716
Batch size 128
717717
@@ -776,7 +776,7 @@ Planner COST
776776
777777
Runtime PIPELINED
778778
779-
Runtime version {neo4j-version-minor}
779+
Runtime version {neo4j-version}
780780
781781
Batch size 128
782782
@@ -823,7 +823,7 @@ Planner COST
823823
824824
Runtime PIPELINED
825825
826-
Runtime version {neo4j-version-minor}
826+
Runtime version {neo4j-version}
827827
828828
Batch size 128
829829
@@ -878,7 +878,7 @@ Planner COST
878878
879879
Runtime PIPELINED
880880
881-
Runtime version {neo4j-version-minor}
881+
Runtime version {neo4j-version}
882882
883883
Batch size 128
884884

modules/ROOT/pages/appendix/tutorials/basic-query-tuning.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ Planner COST
623623
624624
Runtime PIPELINED
625625
626-
Runtime version {neo4j-version-minor}
626+
Runtime version {neo4j-version}
627627
628628
Batch size 128
629629
@@ -680,7 +680,7 @@ Planner COST
680680
681681
Runtime PIPELINED
682682
683-
Runtime version {neo4j-version-minor}
683+
Runtime version {neo4j-version}
684684
685685
Batch size 128
686686
@@ -747,7 +747,7 @@ Planner COST
747747
748748
Runtime PIPELINED
749749
750-
Runtime version {neo4j-version-minor}
750+
Runtime version {neo4j-version}
751751
752752
Batch size 128
753753

modules/ROOT/pages/appendix/tutorials/shortestpath-planning.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Planner COST
8181
8282
Runtime PIPELINED
8383
84-
Runtime version {neo4j-version-minor}
84+
Runtime version {neo4j-version}
8585
8686
Batch size 128
8787
@@ -158,7 +158,7 @@ Planner COST
158158
159159
Runtime PIPELINED
160160
161-
Runtime version {neo4j-version-minor}
161+
Runtime version {neo4j-version}
162162
163163
Batch size 1024
164164
@@ -261,7 +261,7 @@ Planner COST
261261
262262
Runtime PIPELINED
263263
264-
Runtime version {neo4j-version-minor}
264+
Runtime version {neo4j-version}
265265
266266
Batch size 128
267267

modules/ROOT/pages/clauses/call.adoc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ CALL dbms.checkConfigValue('server.bolt.enabled', 'true')
8686
| "valid" | "message"
8787
| true | "requires restart"
8888
89-
1+d|Rows: 2
89+
2+d|Rows: 2
9090
|===
9191
9292
====
@@ -118,7 +118,7 @@ CALL dbms.checkConfigValue($setting, $value)
118118
| "valid" | "message"
119119
| true | "requires restart"
120120
121-
1+d|Rows: 2
121+
2+d|Rows: 2
122122
|===
123123
124124
[NOTE]
@@ -153,7 +153,7 @@ CALL dbms.checkConfigValue($setting, 'true')
153153
| "valid" | "message"
154154
| true | "requires restart"
155155
156-
1+d|Rows: 2
156+
2+d|Rows: 2
157157
|===
158158
159159
====
@@ -189,6 +189,8 @@ CALL db.labels() YIELD *
189189
If the procedure has deprecated return columns, those columns are also returned.
190190
191191
Note that `YIELD *` is only valid in standalone procedure calls.
192+
Variables must be explicitly named in a `YIELD` clause if other clauses than a single procedure `CALL` are present.
193+
This restriction simplifies query logic and protects against output variables from the procedure accidentally clashing with other query variables.
192194
For example, the following is not valid:
193195
194196
.Not allowed
@@ -204,7 +206,7 @@ RETURN count(*) AS results
204206
====
205207
206208
`YIELD` can be used to filter for specific results.
207-
This requires knowing the names of the arguments within a procedure's signature, which can either be found in the link:{neo4j-docs-base-uri}/operations-manual/{page-version}/reference/procedures/[Operations Manual -> Procedures] or returned by a `SHOW PROCEDURES` query.
209+
This requires knowing the names of the arguments within a procedure's signature, which can either be found in the link:{neo4j-docs-base-uri}/operations-manual/{page-version}/reference/procedures/[Operations Manual -> Procedures] or in the `signature` column returned by a `SHOW PROCEDURES` command (see example below).
208210
209211
.Find the argument names of `db.propertyKeys`
210212
[source, cypher]

modules/ROOT/pages/clauses/finish.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,19 @@
33
[[query-finish]]
44
= FINISH
55

6-
A query ending in `FINISH` instead of `RETURN` has no result but executes all its side effects.
6+
A query ending in `FINISH` -- instead of `RETURN` -- has no result but executes all its side effects.
77
`FINISH` was introduced as part of Cypher's xref:appendix/gql-conformance/index.adoc[].
88

99
The following read query successfully executes but has no results:
1010

1111
.Query
12+
// tag::clauses_finish_match[]
1213
[source, cypher]
1314
----
1415
MATCH (p:Person)
1516
FINISH
1617
----
18+
// end::clauses_finish_match[]
1719

1820
The following query has no result but creates one node with the label `Person`:
1921

modules/ROOT/pages/clauses/foreach.adoc

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,17 @@ CREATE
3333
[[foreach-mark-all-nodes-along-a-path]]
3434
== Mark all nodes along a path
3535

36-
This query will set the property `marked` to `true` on all nodes along a path.
36+
This query sets the property `marked` to `true` on all nodes along a path.
3737

3838
.Query
39+
// tag::clauses_foreach_node[]
3940
[source, cypher, indent=0]
4041
----
4142
MATCH p=(start)-[*]->(finish)
4243
WHERE start.name = 'A' AND finish.name = 'D'
4344
FOREACH (n IN nodes(p) | SET n.marked = true)
4445
----
46+
// end::clauses_foreach_node[]
4547

4648
.Result
4749
[role="queryresult",options="footer",cols="1*<m"]
@@ -51,3 +53,47 @@ d|Rows: 0 +
5153
Properties set: 4
5254
|===
5355

56+
57+
[[foreach-mark-all-relationships-along-a-path]]
58+
== Mark all relationships along a path
59+
60+
This query sets the property `marked` to `true` on all relationships along a path.
61+
62+
// tag::clauses_foreach_relationship[]
63+
[source, cypher, indent=0]
64+
----
65+
MATCH p=(start)-[*]->(finish)
66+
WHERE start.name = 'A' AND finish.name = 'D'
67+
FOREACH ( r IN relationships(p) | SET r.marked = true )
68+
----
69+
// end::clauses_foreach_relationship[]
70+
71+
.Result
72+
[role="queryresult",options="footer",cols="1*<m"]
73+
|===
74+
|(empty result)
75+
d|Rows: 0 +
76+
Properties set: 3
77+
|===
78+
79+
[[foreach-create-new-nodes-form-a-list]]
80+
== Create new nodes from a list of name labels
81+
82+
This query creates a new node for each label in a list.
83+
84+
.Query
85+
// tag::clauses_foreach_create[]
86+
[source, cypher, indent=0]
87+
----
88+
WITH ['E', 'F', 'G'] AS names
89+
FOREACH ( value IN names | CREATE (:Person {name: value}) )
90+
----
91+
// end::clauses_foreach_create[]
92+
93+
.Result
94+
[role="queryresult",options="footer",cols="1*<m"]
95+
|===
96+
1+|(empty result)
97+
1+d|Rows: 0 +
98+
Nodes created: 3
99+
|===

modules/ROOT/pages/clauses/limit.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,14 @@ Properties set: 1
166166
`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`].
167167

168168
.Standalone use of `LIMIT`
169+
// tag::clauses_limit_standalone[]
169170
[source, cypher]
170171
----
171172
MATCH (n)
172173
LIMIT 2
173174
RETURN collect(n.name) AS names
174175
----
176+
// end::clauses_limit_standalone[]
175177

176178
.Result
177179
[role="queryresult",options="header,footer",cols="1*<m"]
@@ -185,6 +187,7 @@ The following query orders all nodes by `name` descending, skips the two first r
185187
It then xref:functions/aggregating.adoc#functions-collect[collects] the results in a list.
186188

187189
.`LIMIT` used in conjunction with `ORDER BY` and `SKIP`
190+
// tag::clauses_limit[]
188191
[source, cypher]
189192
----
190193
MATCH (n)
@@ -193,6 +196,7 @@ SKIP 2
193196
LIMIT 2
194197
RETURN collect(n.name) AS names
195198
----
199+
// end::clauses_limit[]
196200

197201
.Result
198202
[role="queryresult",options="header,footer",cols="1*<m"]

modules/ROOT/pages/clauses/load-csv.adoc

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,14 @@ By default, paths are resolved relative to the Neo4j import directory.
4646
----
4747
4848
.Query
49+
// tag::clauses_load_csv_local_files[]
4950
[source, cypher]
5051
----
5152
LOAD CSV FROM 'file:///artists.csv' AS row
5253
MERGE (a:Artist {name: row[1], year: toInteger(row[2])})
5354
RETURN a.name, a.year
5455
----
56+
// end::clauses_load_csv_local_files[]
5557
5658
.Result
5759
[role="queryresult",options="header,footer",cols="2*<m"]
@@ -112,12 +114,14 @@ However, this means that insecure URLs on virtual hosts will not function unless
112114
----
113115
114116
.Query
117+
// tag::clauses_load_csv_remote_locations[]
115118
[source, cypher]
116119
----
117120
LOAD CSV FROM 'https://data.neo4j.com/bands/artists.csv' AS row
118121
MERGE (a:Artist {name: row[1], year: toInteger(row[2])})
119122
RETURN a.name, a.year
120123
----
124+
// end::clauses_load_csv_remote_locations[]
121125
122126
.Result
123127
[role="queryresult",options="header,footer",cols="2*<m"]
@@ -705,10 +709,11 @@ person_tmdbId,bio,born,bornIn,died,person_imdbId,name,person_poster,person_url
705709
----
706710
707711
[NOTE]
708-
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.
709713
If you are using an older version of Neo4j, use an xref:subqueries/call-subquery.adoc#importing-with[importing `WITH` clause] instead.
710714
711715
.Query
716+
// tag::clauses_load_csv_transactions[]
712717
[source, cypher]
713718
----
714719
LOAD CSV WITH HEADERS FROM 'https://data.neo4j.com/importing-cypher/persons.csv' AS row
@@ -717,6 +722,7 @@ CALL (row) {
717722
SET p.name = row.name, p.born = row.born
718723
} IN TRANSACTIONS OF 200 ROWS
719724
----
725+
// end::clauses_load_csv_transactions[]
720726
721727
.Result
722728
[source, role="queryresult"]
@@ -751,11 +757,13 @@ A common use case for this function is to generate sequential unique IDs for CSV
751757
----
752758
753759
.Query
760+
// tag::clauses_load_csv_linenumber[]
754761
[source, cypher]
755762
----
756763
LOAD CSV FROM 'file:///artists.csv' AS row
757764
RETURN linenumber() AS number, row
758765
----
766+
// end::clauses_load_csv_linenumber[]
759767
760768
.Result
761769
[role="queryresult",options="header,footer",cols="2*<m"]
@@ -786,11 +794,13 @@ The xref:functions/load-csv.adoc#functions-file[`file()`] function provides the
786794
----
787795
788796
.Query
797+
// tag::clauses_load_csv_file[]
789798
[source, cypher, role=test-result-skip]
790799
----
791800
LOAD CSV FROM 'file:///artists.csv' AS row
792801
RETURN DISTINCT file() AS path
793802
----
803+
// end::clauses_load_csv_file[]
794804
795805
.Result
796806
[role="queryresult",options="header,footer",cols="1*<m"]
@@ -837,6 +847,7 @@ Id,Name,Year
837847
----
838848
839849
.Query
850+
// tag::clauses_load_csv_headers[]
840851
[source, cypher]
841852
----
842853
LOAD CSV WITH HEADERS FROM 'file:///artists-with-headers.csv' AS row
@@ -845,6 +856,7 @@ RETURN
845856
a.name AS name,
846857
a.year AS year
847858
----
859+
// end::clauses_load_csv_headers[]
848860
849861
.Result
850862
[role="queryresult",options="header,footer",cols="2*<m"]
@@ -880,11 +892,13 @@ If you try to import a file that doesn't use `,` as field delimiter and you also
880892
----
881893
882894
.Query
895+
// tag::clauses_load_csv_field_terminator[]
883896
[source, cypher]
884897
----
885898
LOAD CSV FROM 'file:///artists-fieldterminator.csv' AS row FIELDTERMINATOR ';'
886899
MERGE (:Artist {name: row[1], year: toInteger(row[2])})
887900
----
901+
// end::clauses_load_csv_field_terminator[]
888902
889903
.Result
890904
[source, role="queryresult"]

0 commit comments

Comments
 (0)