apoc.trigger.pause

This procedure is not intended to be used in a cluster environment, and may act unpredictably.

Please note that this procedure is deprecated.

Use the following ones instead, which allow for better support in a cluster:

deprecated procedure

new procedure

apoc.trigger.add(name STRING, statement STRING, selector MAP<STRING, ANY>, config MAP<STRING, ANY>)

apoc.trigger.install(databaseName STRING, name STRING, statement STRING, selector MAP<STRING, ANY>, config MAP<STRING, ANY>)

apoc.trigger.remove(name STRING)

apoc.trigger.drop(databaseName STRING, name STRING)

apoc.trigger.removeAll()

apoc.trigger.dropAll(databaseName STRING)

apoc.trigger.pause(name STRING)

apoc.trigger.stop(databaseName STRING, name STRING)

apoc.trigger.resume(name STRING)

apoc.trigger.start(databaseName STRING, name STRING)

where databaseName is the database where we want to execute the triggers.

Details

Syntax

apoc.trigger.pause(name) :: (name, query, selector, params, installed, paused)

Description

Pauses the given trigger.

Input arguments

Name

Type

Description

name

STRING

The name of the trigger to pause.

Return arguments

Name

Type

Description

name

STRING

The name of the trigger.

query

STRING

The query belonging to the trigger.

selector

MAP

{ phase = "before" :: ["before", "rollback", "after", "afterAsync"] }

params

MAP

The parameters for the given Cypher statement.

installed

BOOLEAN

Whether or not the trigger was installed.

paused

BOOLEAN

Whether or not the trigger was paused.

Enable Triggers

By default triggers are disabled. We can enable them by setting the following property in apoc.conf:

apoc.conf
apoc.trigger.enabled=true
apoc.trigger.refresh=60000
Description
Option Key Value Description

apoc.trigger.enabled

true/false, default false

Enable/Disable the feature

apoc.trigger.refresh

number, default 60000

Interval in ms after which a replication check is triggered across all cluster nodes

Usage Examples

If we want to pause the trigger created by the example in apoc.trigger.add, we can run the following query:

CALL apoc.trigger.pause("count-removals");
Results
name query selector params installed paused

"count-removals"

MATCH (c:Counter) SET c.count = c.count + size([f IN $deletedNodes WHERE id(f)  0])

{}

{}

TRUE

TRUE