apoc.cypher.runManyReadOnlyProcedure
|
This procedure is not considered safe to run from multiple threads. It is therefore not supported by the parallel runtime. For more information, see the Cypher Manual → Parallel runtime. |
Syntax |
|
||
Description |
Runs each semicolon separated read-only statement and returns a summary of the statement outcomes. |
||
Input arguments |
Name |
Type |
Description |
|
|
The Cypher statements to run, semicolon separated ( |
|
|
|
The parameters for the given Cypher statements. |
|
|
|
|
|
Return arguments |
Name |
Type |
Description |
|
|
The row number of the run Cypher statement. |
|
|
|
The result returned from the Cypher statement. |
|
Example
Given this dataset:
CREATE (:Person {name: 'Alice', age: 30}),
(:Person {name: 'Bob', age: 25}),
(:Person {name: 'Charlie', age: 35})
The following query runs two semicolon-separated read-only statements in a single call. Row numbers reset independently for each statement:
CALL apoc.cypher.runManyReadOnly(
'MATCH (p:Person) WHERE p.age < 30 RETURN p.name AS name;
MATCH (p:Person) WHERE p.age >= 30 RETURN p.name AS name ORDER BY p.name;',
{},
{statistics: false}
)
YIELD row, result
| row | result |
|---|---|
0 |
{name: "Bob"} |
0 |
{name: "Alice"} |
1 |
{name: "Charlie"} |
The row counter resets to 0 at the start of each statement.
By default (statistics: true), each statement also appends a summary row with row: -1 containing query statistics such as nodesCreated and propertiesSet.
This is disabled in the example above via statistics: false.
Any write operations passed to apoc.cypher.runManyReadOnly are silently skipped - use apoc.cypher.runMany if write operations are
required.