Skip to content

Commit 686e67c

Browse files
fix CALL query in clause composition page (#1038)
1 parent 0d22fcc commit 686e67c

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

modules/ROOT/pages/clauses/clause-composition.adoc

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -572,16 +572,19 @@ Later invocations of the subquery can observe writes made by earlier invocations
572572
======
573573
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:
574574
575+
[NOTE]
576+
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.
577+
If you are using an older version of Neo4j, use an xref:subqueries/call-subquery.adoc#importing-with[importing `WITH` clause] instead.
578+
575579
[source,cypher]
576580
----
577581
MATCH (john:Person {name: 'John'})
578582
SET john.friends = []
579583
WITH john
580584
MATCH (john)-[:FRIEND]->(friend)
581585
WITH john, friend
582-
CALL {
583-
WITH john, friend
584-
WITH *, john.friends AS friends
586+
CALL (john, friend) {
587+
WITH john.friends AS friends
585588
SET john.friends = friends + friend.name
586589
}
587590
----
@@ -756,7 +759,7 @@ label = "{Person\|name = \'Maria\'\l}"
756759
757760
| First invocation of
758761
----
759-
WITH *, john.friends AS friends
762+
WITH john.friends AS friends
760763
----
761764
|
762765
[options="header",cols="2m, 1m, 1m"]
@@ -850,7 +853,7 @@ label = "{Person\|name = \'Maria\'\l}"
850853
851854
| Second invocation of
852855
----
853-
WITH *, john.friends AS friends
856+
WITH john.friends AS friends
854857
----
855858
|
856859
[options="header",cols="2m, 1m, 1m"]

0 commit comments

Comments
 (0)