apoc.cypher.mapParallel2
Procedure Apoc Extended Deprecated
apoc.cypher.mapParallel2(fragment, params, list-to-parallelize) yield value - executes fragment in parallel batches with the list segments being assigned to _
Signature
apoc.cypher.mapParallel2(fragment :: STRING?, params :: MAP?, list :: LIST? OF ANY?, partitions :: INTEGER?, timeout = 10 :: INTEGER?) :: (value :: MAP?)
Input parameters
Name | Type | Default |
---|---|---|
fragment |
STRING? |
null |
params |
MAP? |
null |
list |
LIST? OF ANY? |
null |
partitions |
INTEGER? |
null |
timeout |
INTEGER? |
10 |
Output parameters
Name | Type |
---|---|
value |
MAP? |
Note: this procedure is deprecated. Use Cypher runtime parallel for single read-only operations:
CYPHER runtime=parallel
CALL {
MATCH (p:Post)
WITH
CASE
WHEN p.updatedAt IS NULL THEN [p.createdAt]
ELSE [p.createdAt, p.updatedAt]
END AS activityDates
UNWIND activityDates AS activityDate
RETURN activityDate
UNION ALL
MATCH (u:User)
UNWIND [u.createdAt, u.accessedAt] AS activityDate
RETURN activityDate
}
RETURN activityDate.year AS year,
activityDate.month AS month,
count(*) AS activity
ORDER BY activity DESC, year, month
LIMIT 10
or, alternatively, for write operations use IN CONCURRENT TRANSACTIONS:
:auto
CALL {
UNWIND range(0,9) as b
MATCH (m:Movie { ranking: b }) RETURN m
} IN CONCURRENT TRANSACTIONS
WITH m.ranking as rank
MATCH (n:Movie)
SET n.ranking = 11
RETURN n