Skip to content

Commit d667067

Browse files
rsill-neo4jJoelBergstrandJPryce-Aklundh
authored
NEXT documentation (#1273)
Co-authored-by: JoelBergstrand <[email protected]> Co-authored-by: Jens Pryce-Åklundh <[email protected]>
1 parent a8c0375 commit d667067

File tree

8 files changed

+410
-6
lines changed

8 files changed

+410
-6
lines changed

modules/ROOT/content-nav.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
** xref:queries/composed-queries/index.adoc[]
1010
*** xref:queries/composed-queries/combined-queries.adoc[]
1111
*** xref:queries/composed-queries/conditional-queries.adoc[]
12+
*** xref:queries/composed-queries/sequential-queries.adoc[]
1213
1314
* xref:clauses/index.adoc[]
1415
** xref:clauses/clause-composition.adoc[]

modules/ROOT/pages/appendix/gql-conformance/supported-optional.adoc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ These codes order the features in the table below.
4646
| G020
4747
| Counted shortest group search
4848
| xref:patterns/shortest-paths.adoc#shortest-groups[`SHORTEST GROUPS`]
49-
|
49+
|
50+
5051

5152
| G035
5253
| Quantified paths
@@ -188,6 +189,11 @@ For example, GQL’s graph reference values `CURRENT_GRAPH` and `CURRENT_PROPERT
188189
| xref:clauses/limit.adoc[`LIMIT`], xref:clauses/order-by.adoc[`ORDER BY`]
189190
| Cypher requires using the xref:clauses/with.adoc[`WITH`] clause, which GQL does not.
190191

192+
| GQ20
193+
| Advanced linear composition with NEXT
194+
| xref:queries/composed-queries/sequential-queries.adoc[]
195+
| The GQL standard includes a `YIELD` clause for its `NEXT` statement which Cypher does not implement.
196+
191197
| GV39
192198
| Temporal types: date, local datetime, and local time support
193199
| xref:values-and-types/temporal.adoc[Temporal types], xref:functions/temporal/index.adoc#functions-date[`date()`]

modules/ROOT/pages/deprecations-additions-removals-compatibility.adoc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,22 @@ a|
235235
label:functionality[]
236236
label:new[]
237237

238+
[source, cypher, role="noheader"]
239+
----
240+
RETURN 1 AS a
241+
242+
NEXT
243+
244+
RETURN 1 AS b
245+
----
246+
247+
| New `NEXT` keyword used for linear composition of queries.
248+
For more information, see xref:queries/composed-queries/sequential-queries.adoc[].
249+
250+
a|
251+
label:functionality[]
252+
label:new[]
253+
238254
[source, cypher, role="noheader"]
239255
----
240256
MATCH (s:Supplier)-[:SUPPLIES]->(p:Product)
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
= Composed queries
22
:description: Overview about how to use `UNION` and `WHEN` to construct combined or conditional queries in Cypher.
33

4-
`UNION` and `WHEN` enable the composition of multiple separate query branches within a single query.
5-
`UNION` allows for combining the results of different queries, while `WHEN` enables conditional queries, where different query branches can be made to execute depending on a set of criteria.
6-
As such, `UNION` and `WHEN` manage in different ways the execution flow and logic of queries and cannot be used in queries as regular clauses.
4+
`UNION`, `WHEN` and `NEXT` enable the composition of multiple separate query branches within a single query.
5+
`UNION` allows for combining the results of different queries.
6+
`WHEN` enables conditional queries, where different query branches can be made to execute depending on a set of criteria.
7+
Finally, `NEXT` allows for the linear composition of sequential queries, passing the return values from one query to the next.
8+
As such, `UNION`, `WHEN`, and `NEXT` manage in different ways the execution flow and logic of queries and cannot be used in queries as regular clauses.
79

810
For more information, see:
911

1012
* xref:queries/composed-queries/combined-queries.adoc[]
1113
* xref:queries/composed-queries/conditional-queries.adoc[] label:new[Introduced in Neo4j 2025.06]
14+
* xref:queries/composed-queries/sequential-queries.adoc[] label:new[Introduced in Neo4j 2025.06]

0 commit comments

Comments
 (0)