Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ALL keyword to RETURN clause as part of GQL compliance #1139

Draft
wants to merge 1 commit into
base: cypher-25
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ The only way to guarantee row order in Neo4j is to use xref:clauses/order-by.ado
| 14.11
| <return statement>
| xref:clauses/return.adoc[`RETURN`]
| GQL defines the option to specify `RETURN ALL` (functionally equivalent to using `RETURN` on its own).
This is currently not available in Cypher.
|

| 16.2
| <limit clause>
Expand Down
23 changes: 23 additions & 0 deletions modules/ROOT/pages/clauses/return.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -236,3 +236,26 @@ The `Movie` node `'Man of Tai Chi'` is returned by the query, but only once (wit
d|Rows: 1
|===

[[return-all-results]]
== RETURN ALL

Returning all results can also be accomplished by explicitly including `ALL` in the `RETURN`.
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`.

.Query
[source, cypher]
----
MATCH (p:Person {name: 'Keanu Reeves'})-->(m)
RETURN ALL m
----

The same node is returned twice, as there are two relationships connecting to it from `'Keanu Reeves'`.

.Result
[role="queryresult",options="header,footer",cols="1*<m"]
|===
| m
| {"title":"Man of Tai Chi","released":2013}+
| {"title":"Man of Tai Chi","released":2013}+
d|Rows: 1
|===
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,25 @@ Several xref:clauses/transaction-clauses.adoc#query-listing-transactions[`SHOW
* 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.
|===

=== New features

[cols="2", options="header"]
|===
| Feature
| Details

a|
label:functionality[]
label:new[]
[source, cypher, role=noheader]
----
MATCH (n)
RETURN ALL n.prop AS prop
----
| 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.

|===

[[cypher-deprecations-additions-removals-5.26]]
== Neo4j 5.26

Expand Down
Loading