From 6df09b94111a291ef86b6f5e9b08f936165c7cf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20Pryce-=C3=85klundh?= <112686610+JPryce-Aklundh@users.noreply.github.com> Date: Tue, 22 Oct 2024 10:36:54 +0200 Subject: [PATCH 1/4] update --- modules/ROOT/pages/clauses/union.adoc | 7 ++++++- modules/ROOT/pages/clauses/use.adoc | 5 +++-- modules/ROOT/pages/functions/graph.adoc | 14 ++++++++++++-- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/modules/ROOT/pages/clauses/union.adoc b/modules/ROOT/pages/clauses/union.adoc index 85b261d97..ff4724ba9 100644 --- a/modules/ROOT/pages/clauses/union.adoc +++ b/modules/ROOT/pages/clauses/union.adoc @@ -131,10 +131,15 @@ The combined result is returned, without duplicates. The `UNION` clause can be used within a xref:subqueries/call-subquery.adoc[`CALL` subquery] to further process the combined results before a final output is returned. For example, the below query xref:functions/aggregating.adoc#functions-count[counts] the occurrences of each `name` property returned after the `UNION ALL` within the `CALL` subquery. +[NOTE] +The below query uses an empty xref:subqueries/call-subquery.adoc#variable-scope-clause[variable scope clause]: `CALL () { ... }` (introduced in Neo4j 5.23). +If you are using an older version of Neo4j, use `CALL { ... } instead. +For more information, see xref:subqueries/call-subquery.adoc#import-variables[CALL subqueries -> Importing variables]. + .Query [source, cypher] ---- -CALL { +CALL () { MATCH (a:Actor) RETURN a.name AS name UNION ALL diff --git a/modules/ROOT/pages/clauses/use.adoc b/modules/ROOT/pages/clauses/use.adoc index 20df616ca..6864c8f24 100644 --- a/modules/ROOT/pages/clauses/use.adoc +++ b/modules/ROOT/pages/clauses/use.adoc @@ -41,13 +41,14 @@ USE + [source, syntax, role="noheader"] ---- -CALL { +CALL () { USE } ---- + -In subqueries, a `USE` clause may appear as the second clause, if directly following an xref::subqueries/call-subquery.adoc#call-importing-variables[importing `WITH` clause]. +In subqueries, a `USE` clause may appear directly following the xref:subqueries/call-subquery.adoc#variable-scope-clause[variable scope clause]: `CALL () { ... }` (introduced in Neo4j 5.23). +Or, if you are using an older version of Neo4j, directly following an xref::subqueries/call-subquery.adoc#call-importing-variables[importing `WITH` clause]. When executing queries against a composite database, the `USE` clause must only refer to graphs that are part of the current composite database. diff --git a/modules/ROOT/pages/functions/graph.adoc b/modules/ROOT/pages/functions/graph.adoc index 8ac1fcd0e..b9914b713 100644 --- a/modules/ROOT/pages/functions/graph.adoc +++ b/modules/ROOT/pages/functions/graph.adoc @@ -117,7 +117,7 @@ Properties for all graphs on the current composite database are returned. UNWIND graph.names() AS name WITH name, graph.propertiesByName(name) AS props WHERE "A" IN props.tags -CALL { +CALL () { USE graph.byName(name) MATCH (n) RETURN n @@ -127,6 +127,11 @@ RETURN n Returns all nodes from a subset of graphs that have a `tags` property containing `"A"`. +[NOTE] +The above query uses an empty xref:subqueries/call-subquery.adoc#variable-scope-clause[variable scope clause]: `CALL () { ... }` (introduced in Neo4j 5.23). +If you are using an older version of Neo4j, use `CALL { ... } instead. +For more information, see xref:subqueries/call-subquery.adoc#import-variables[CALL subqueries -> Importing variables]. + ====== [[functions-graph-byname]] @@ -148,7 +153,7 @@ Returns all nodes from a subset of graphs that have a `tags` property containing [source, cypher, indent=0] ---- UNWIND graph.names() AS graphName -CALL { +CALL () { USE graph.byName(graphName) MATCH (n) RETURN n @@ -158,6 +163,11 @@ RETURN n Returns all nodes from all graphs on the current composite database. +[NOTE] +The above query uses an empty xref:subqueries/call-subquery.adoc#variable-scope-clause[variable scope clause]: `CALL () { ... }` (introduced in Neo4j 5.23). +If you are using an older version of Neo4j, use `CALL { ... } instead. +For more information, see xref:subqueries/call-subquery.adoc#import-variables[CALL subqueries -> Importing variables]. + ====== [role=label--new-5.13] From 95b9b3bf76980f1bd9035aa97bc020663f9ac535 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20Pryce-=C3=85klundh?= <112686610+JPryce-Aklundh@users.noreply.github.com> Date: Tue, 22 Oct 2024 10:41:53 +0200 Subject: [PATCH 2/4] add missing backtick --- modules/ROOT/pages/clauses/union.adoc | 2 +- modules/ROOT/pages/functions/graph.adoc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/ROOT/pages/clauses/union.adoc b/modules/ROOT/pages/clauses/union.adoc index ff4724ba9..2df4687aa 100644 --- a/modules/ROOT/pages/clauses/union.adoc +++ b/modules/ROOT/pages/clauses/union.adoc @@ -133,7 +133,7 @@ For example, the below query xref:functions/aggregating.adoc#functions-count[cou [NOTE] The below query uses an empty xref:subqueries/call-subquery.adoc#variable-scope-clause[variable scope clause]: `CALL () { ... }` (introduced in Neo4j 5.23). -If you are using an older version of Neo4j, use `CALL { ... } instead. +If you are using an older version of Neo4j, use `CALL { ... }` instead. For more information, see xref:subqueries/call-subquery.adoc#import-variables[CALL subqueries -> Importing variables]. .Query diff --git a/modules/ROOT/pages/functions/graph.adoc b/modules/ROOT/pages/functions/graph.adoc index b9914b713..9404b48f5 100644 --- a/modules/ROOT/pages/functions/graph.adoc +++ b/modules/ROOT/pages/functions/graph.adoc @@ -129,7 +129,7 @@ Returns all nodes from a subset of graphs that have a `tags` property containing [NOTE] The above query uses an empty xref:subqueries/call-subquery.adoc#variable-scope-clause[variable scope clause]: `CALL () { ... }` (introduced in Neo4j 5.23). -If you are using an older version of Neo4j, use `CALL { ... } instead. +If you are using an older version of Neo4j, use `CALL { ... }` instead. For more information, see xref:subqueries/call-subquery.adoc#import-variables[CALL subqueries -> Importing variables]. ====== @@ -165,7 +165,7 @@ Returns all nodes from all graphs on the current composite database. [NOTE] The above query uses an empty xref:subqueries/call-subquery.adoc#variable-scope-clause[variable scope clause]: `CALL () { ... }` (introduced in Neo4j 5.23). -If you are using an older version of Neo4j, use `CALL { ... } instead. +If you are using an older version of Neo4j, use `CALL { ... }` instead. For more information, see xref:subqueries/call-subquery.adoc#import-variables[CALL subqueries -> Importing variables]. ====== From 1cb78da16893ccb59ebac81609e612332b8cdc9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20Pryce-=C3=85klundh?= <112686610+JPryce-Aklundh@users.noreply.github.com> Date: Tue, 22 Oct 2024 10:47:17 +0200 Subject: [PATCH 3/4] fix link to importing with --- modules/ROOT/pages/clauses/use.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/pages/clauses/use.adoc b/modules/ROOT/pages/clauses/use.adoc index 6864c8f24..663c483f6 100644 --- a/modules/ROOT/pages/clauses/use.adoc +++ b/modules/ROOT/pages/clauses/use.adoc @@ -48,7 +48,7 @@ CALL () { ---- + In subqueries, a `USE` clause may appear directly following the xref:subqueries/call-subquery.adoc#variable-scope-clause[variable scope clause]: `CALL () { ... }` (introduced in Neo4j 5.23). -Or, if you are using an older version of Neo4j, directly following an xref::subqueries/call-subquery.adoc#call-importing-variables[importing `WITH` clause]. +Or, if you are using an older version of Neo4j, directly following an xref::subqueries/call-subquery.adoc##importing-with[importing `WITH` clause]. When executing queries against a composite database, the `USE` clause must only refer to graphs that are part of the current composite database. From 0e7b7fa7d2e8bd959903910b1b53e1a220b0ad78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20Pryce-=C3=85klundh?= <112686610+JPryce-Aklundh@users.noreply.github.com> Date: Tue, 22 Oct 2024 10:55:34 +0200 Subject: [PATCH 4/4] final --- modules/ROOT/pages/clauses/use.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/pages/clauses/use.adoc b/modules/ROOT/pages/clauses/use.adoc index 663c483f6..29c744c72 100644 --- a/modules/ROOT/pages/clauses/use.adoc +++ b/modules/ROOT/pages/clauses/use.adoc @@ -48,7 +48,7 @@ CALL () { ---- + In subqueries, a `USE` clause may appear directly following the xref:subqueries/call-subquery.adoc#variable-scope-clause[variable scope clause]: `CALL () { ... }` (introduced in Neo4j 5.23). -Or, if you are using an older version of Neo4j, directly following an xref::subqueries/call-subquery.adoc##importing-with[importing `WITH` clause]. +Or, if you are using an older version of Neo4j, directly following an xref::subqueries/call-subquery.adoc#importing-with[importing `WITH` clause]. When executing queries against a composite database, the `USE` clause must only refer to graphs that are part of the current composite database.