diff --git a/modules/ROOT/pages/clauses/finish.adoc b/modules/ROOT/pages/clauses/finish.adoc index b233b4896..27813a216 100644 --- a/modules/ROOT/pages/clauses/finish.adoc +++ b/modules/ROOT/pages/clauses/finish.adoc @@ -3,26 +3,30 @@ [[query-finish]] = FINISH -A query ending in `FINISH` — instead of `RETURN` — has no result but executes all its side effects. +A query ending in `FINISH` -- instead of `RETURN` -- has no result but executes all its side effects. `FINISH` was introduced as part of Cypher's xref:appendix/gql-conformance/index.adoc[]. The following read query successfully executes but has no results: .Query +// tag::clauses_finish_match[] [source, cypher] ---- MATCH (p:Person) FINISH ---- +// end::clauses_finish_match[] The following query has no result but creates one node with the label `Person`: .Query +// tag::clauses_finish_create[] [source, cypher] ---- CREATE (p:Person) FINISH ---- +// end::clauses_finish_create[] It is equivalent to the following query: diff --git a/modules/ROOT/pages/clauses/foreach.adoc b/modules/ROOT/pages/clauses/foreach.adoc index b594ecace..b9678fb2e 100644 --- a/modules/ROOT/pages/clauses/foreach.adoc +++ b/modules/ROOT/pages/clauses/foreach.adoc @@ -36,12 +36,14 @@ CREATE This query will set the property `marked` to `true` on all nodes along a path. .Query +// tag::clauses_foreach[] [source, cypher, indent=0] ---- MATCH p=(start)-[*]->(finish) WHERE start.name = 'A' AND finish.name = 'D' FOREACH (n IN nodes(p) | SET n.marked = true) ---- +// end::clauses_foreach[] .Result [role="queryresult",options="footer",cols="1*