Skip to content

Commit 80d4f1c

Browse files
committed
Add ALL keyword to RETURN clause as part of GQL compliance
1 parent f850924 commit 80d4f1c

File tree

3 files changed

+43
-2
lines changed

3 files changed

+43
-2
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ The only way to guarantee row order in Neo4j is to use xref:clauses/order-by.ado
6868
| 14.11
6969
| <return statement>
7070
| xref:clauses/return.adoc[`RETURN`]
71-
| GQL defines the option to specify `RETURN ALL` (functionally equivalent to using `RETURN` on its own).
72-
This is currently not available in Cypher.
71+
|
7372

7473
| 16.2
7574
| <limit clause>

modules/ROOT/pages/clauses/return.adoc

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,3 +236,26 @@ The `Movie` node `'Man of Tai Chi'` is returned by the query, but only once (wit
236236
d|Rows: 1
237237
|===
238238

239+
[[return-all-results]]
240+
== RETURN ALL
241+
242+
Returning all results can also be accomplished by explicitly including `ALL` in the `RETURN`.
243+
The `RETURN ALL` keyword was introduced as part of Cypher's xref:appendix/gql-conformance/index.adoc[], and using it is functionally the same as using simple `RETURN`.
244+
245+
.Query
246+
[source, cypher]
247+
----
248+
MATCH (p:Person {name: 'Keanu Reeves'})-->(m)
249+
RETURN ALL m
250+
----
251+
252+
The same node is returned twice, as there are two relationships connecting to it from `'Keanu Reeves'`.
253+
254+
.Result
255+
[role="queryresult",options="header,footer",cols="1*<m"]
256+
|===
257+
| m
258+
| {"title":"Man of Tai Chi","released":2013}+
259+
| {"title":"Man of Tai Chi","released":2013}+
260+
d|Rows: 1
261+
|===

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,25 @@ Several xref:clauses/transaction-clauses.adoc#query-listing-transactions[`SHOW
134134
* The current query-related columns — `currentQuery`, `currentQueryId`, `parameters`, `planner`, `runtime`, `indexes`, `currentQueryStartTime`, `currentQueryElapsedTime`, `currentQueryCpuTime`, `currentQueryIdleTime`, and `currentQueryStatus` — now return `null` when no query is executing.
135135
|===
136136

137+
=== New features
138+
139+
[cols="2", options="header"]
140+
|===
141+
| Feature
142+
| Details
143+
144+
a|
145+
label:functionality[]
146+
label:new[]
147+
[source, cypher, role=noheader]
148+
----
149+
MATCH (n)
150+
RETURN ALL n.prop AS prop
151+
----
152+
| The keyword `ALL` can now be added after a xref:clauses/return.adoc#return-all-results[RETURN] as the explicit form of a `RETURN` without duplicate removal.
153+
154+
|===
155+
137156
[[cypher-deprecations-additions-removals-5.26]]
138157
== Neo4j 5.26
139158

0 commit comments

Comments
 (0)