Skip to content

Commit

Permalink
Finish clause (#898)
Browse files Browse the repository at this point in the history
This PR documents the FINISH clause, cf.
neo-technology/neo4j#24360

---------

Co-authored-by: Richard Sill <[email protected]>
Co-authored-by: Jens Pryce-Åklundh <[email protected]>
  • Loading branch information
3 people authored Mar 15, 2024
1 parent 731be8f commit 58025bc
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
build/
node_modules/
build.log
.idea/
.idea/
*.iml
1 change: 1 addition & 0 deletions modules/ROOT/content-nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
** xref:clauses/return.adoc[]
** xref:clauses/with.adoc[]
** xref:clauses/unwind.adoc[]
** xref:clauses/finish.adoc[]
** xref:clauses/where.adoc[]
** xref:clauses/order-by.adoc[]
** xref:clauses/skip.adoc[]
Expand Down
32 changes: 32 additions & 0 deletions modules/ROOT/pages/clauses/finish.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
:description: The `FINISH` clause defines a query to have no result.
:page-role: new-5.19
[[query-finish]]
= FINISH

A query ending in `FINISH` — instead of `RETURN` — has no result but executes all its side effects.

The following read query successfully executes but has no results:

.Query
[source, cypher]
----
MATCH (p:Person)
FINISH
----

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

.Query
[source, cypher]
----
CREATE (p:Person)
FINISH
----

It is equivalent to the following query:

.Query
[source, cypher]
----
CREATE (p:Person)
----
3 changes: 3 additions & 0 deletions modules/ROOT/pages/clauses/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ m| xref::clauses/with.adoc[WITH ... [AS]]
m| xref::clauses/unwind.adoc[UNWIND ... [AS]]
| Expands a list into a sequence of rows.

m| xref::clauses/finish.adoc[FINISH]
| Defines a query to have no result.

|===

[[reading-sub-clauses]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,28 @@ New features are added to the language continuously, and occasionally, some feat
This section lists all of the features that have been removed, deprecated, added, or extended in different Cypher versions.
Replacement syntax for deprecated and removed features are also indicated.

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

=== New features

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

a|
label:syntax[]
label:functionality[]
label:new[]
[source, cypher, role=noheader]
----
FINISH
----
| New xref:clauses/finish.adoc[FINISH] clause, which can be optionally used to define a query that returns no result.

|===

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

Expand Down

0 comments on commit 58025bc

Please sign in to comment.