apoc.trigger.list

Details

Syntax

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

Description

Lists all currently installed triggers for the session database.

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

This example assumes that we’ve first executed the apoc.trigger.install procedure described here:

CALL apoc.trigger.list();
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

FALSE