apoc.periodic.countdown

Procedure

apoc.periodic.countdown(name STRING, statement STRING, delay INTEGER) - runs a repeatedly called background statement until it returns 0.

Signature

apoc.periodic.countdown(name :: STRING, statement :: STRING, delay :: INTEGER) :: (name :: STRING, delay :: INTEGER, rate :: INTEGER, done :: BOOLEAN, cancelled :: BOOLEAN)

Input parameters

Name Type Default

name

STRING

null

statement

STRING

null

delay

INTEGER

null

Output parameters

Name Type

name

STRING

delay

INTEGER

rate

INTEGER

done

BOOLEAN

cancelled

BOOLEAN

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);