apoc.trigger.removeAll

Procedure APOC Core Deprecated

removes all previously added trigger, returns trigger information

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>', '<query>', $phase, $config)

apoc.trigger.add('<dbName>', '<name>', '<query>', $phase, $config)

apoc.trigger.remove('<name>')

apoc.trigger.drop('<dbName>', '<name>')

apoc.trigger.removeAll()

apoc.trigger.removeAll('<dbName>')

apoc.trigger.pause('<name>')

apoc.trigger.stop('<dbName>', '<name>')

apoc.trigger.resume('<name>')

apoc.trigger.start('<dbName>', '<name>')

where <dbName> is the database where we want to execute the triggers.

Signature

apoc.trigger.removeAll() :: (name :: STRING?, query :: STRING?, selector :: MAP?, params :: MAP?, installed :: BOOLEAN?, paused :: BOOLEAN?)

Output parameters

Name Type

name

STRING?

query

STRING?

selector

MAP?

params

MAP?

installed

BOOLEAN?

paused

BOOLEAN?

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
Table 1. 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 remove all triggers, including the one created by the example in apoc.trigger.add, we can run the following query:

CALL apoc.trigger.removeAll();
Table 2. 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])

{}

{}

FALSE

FALSE