apoc.periodic.countdown
Syntax |
|
||
Description |
Runs a repeatedly called background statement until it returns 0. |
||
Input arguments |
Name |
Type |
Description |
|
|
The name of the job. |
|
|
|
The Cypher statement to run, returning a count on each run indicating the remaining iterations. |
|
|
|
The delay in seconds to wait between each job execution. |
|
Return arguments |
Name |
Type |
Description |
|
|
The name of the job. |
|
|
|
The delay on the job. |
|
|
|
The rate of the job. |
|
|
|
If the job has completed. |
|
|
|
If the job has been cancelled. |
Usage Examples
The examples in this section are based on the following sample graph:
CREATE (:Counter {value: 10000});
The following decrements the
value
once a second until it gets to 0:CALL apoc.periodic.countdown(
"decrement",
"MATCH (counter:Counter)
SET counter.value = counter.value - 1
RETURN counter.value as count",
1);