Skip to content

Commit

Permalink
fix CALL query in clause composition page (#1038)
Browse files Browse the repository at this point in the history
  • Loading branch information
JPryce-Aklundh committed Sep 11, 2024
1 parent 0d22fcc commit 686e67c
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions modules/ROOT/pages/clauses/clause-composition.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -572,16 +572,19 @@ Later invocations of the subquery can observe writes made by earlier invocations
======
Using the same example graph as above, this example shows the table of intermediate results and the state of the graph after each clause for the following query:
[NOTE]
The below query 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.
If you are using an older version of Neo4j, use an xref:subqueries/call-subquery.adoc#importing-with[importing `WITH` clause] instead.
[source,cypher]
----
MATCH (john:Person {name: 'John'})
SET john.friends = []
WITH john
MATCH (john)-[:FRIEND]->(friend)
WITH john, friend
CALL {
WITH john, friend
WITH *, john.friends AS friends
CALL (john, friend) {
WITH john.friends AS friends
SET john.friends = friends + friend.name
}
----
Expand Down Expand Up @@ -756,7 +759,7 @@ label = "{Person\|name = \'Maria\'\l}"
| First invocation of
----
WITH *, john.friends AS friends
WITH john.friends AS friends
----
|
[options="header",cols="2m, 1m, 1m"]
Expand Down Expand Up @@ -850,7 +853,7 @@ label = "{Person\|name = \'Maria\'\l}"
| Second invocation of
----
WITH *, john.friends AS friends
WITH john.friends AS friends
----
|
[options="header",cols="2m, 1m, 1m"]
Expand Down

0 comments on commit 686e67c

Please sign in to comment.