You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The query below uses a xref:subqueries/call-subquery.adoc#variable-scope-clause[variable scope clause] (introduced in Neo4j 5.23) to import variables into the `CALL` subquery.
712
-
If you are using an older version of Neo4j, use an xref:subqueries/call-subquery.adoc#importing-with[importing `WITH` clause] instead.
711
+
The below query uses a xref:subqueries/call-subquery.adoc#variable-scope-clause[variable scope clause] to import variables into the `CALL` subquery.
@@ -169,6 +169,7 @@ More specifically, a variable imported into a `CALL` subquery will be available
169
169
In the below example, the `x` variable is imported to the inside scope of a `CALL` subquery, and is successfully referenced by the `RETURN` clause even though the preceding `WITH` neglects to list it.
170
170
171
171
.Variables cannot be de-scoped in the inner scope of a subquery
@@ -200,6 +202,7 @@ For more information, see xref:subqueries/call-subquery.adoc#import-variables[`C
200
202
In the below query, the value of the xref:expressions/string-operators.adoc[`STRING` concatenation] expression is bound to a new variable `customerFullName`, and the value from the expression `chocolate.price * (1 - customer.discount)` is bound to `chocolateNetPrice`, both of which are then available in the `RETURN` clause.
201
203
202
204
.Bind values to variables
205
+
// tag::clauses_with_bind_values[]
203
206
[source, cypher]
204
207
----
205
208
MATCH (customer:Customer)-[:BUYS]->(chocolate:Product {name: 'Chocolate'})
@@ -208,6 +211,7 @@ WITH customer.firstName || ' ' || customer.lastName AS customerFullName,
@@ -267,6 +273,7 @@ In this example, the xref:functions/aggregating.adoc#functions-sum[`sum()`] func
267
273
The xref:functions/aggregating.adoc#functions-collect[`collect()`] function is used to collect each product into `LIST` values bound to the `productsBought` variable.
0 commit comments