diff --git a/modules/ROOT/pages/appendix/gql-conformance/supported-mandatory.adoc b/modules/ROOT/pages/appendix/gql-conformance/supported-mandatory.adoc index fc2c528fd..ff76821d2 100644 --- a/modules/ROOT/pages/appendix/gql-conformance/supported-mandatory.adoc +++ b/modules/ROOT/pages/appendix/gql-conformance/supported-mandatory.adoc @@ -73,8 +73,7 @@ The only way to guarantee row order in Neo4j is to use xref:clauses/order-by.ado | 14.11 | | 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. +| | 15.4 | diff --git a/modules/ROOT/pages/clauses/return.adoc b/modules/ROOT/pages/clauses/return.adoc index 323fc40cd..cc062f72c 100644 --- a/modules/ROOT/pages/clauses/return.adoc +++ b/modules/ROOT/pages/clauses/return.adoc @@ -236,3 +236,27 @@ The `Movie` node `'Man of Tai Chi'` is returned by the query, but only once (wit d|Rows: 1 |=== +[role=label--new-2025.05] +[[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*(p) +WITH DISTINCT p.name AS name +RETURN name +---- + +`'George'` is returned by the query, but only once (without the `DISTINCT` operator it would have been returned twice because there are two `KNOWS` relationships going to it): + +.Result +[role="queryresult",options="header,footer",cols="1*(p) +WITH ALL p.name AS name +RETURN name +---- + +The same name is returned twice, as there are two `KNOWS` relationships connecting to it. + +.Result +[role="queryresult",options="header,footer",cols="1*