apoc.trigger.show
Procedure APOC Core
CALL apoc.trigger.show(databaseName) | it lists all eventually installed triggers for a database
Signature
apoc.trigger.show(databaseName :: STRING?) :: (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.trigger.enabled=true
apoc.trigger.refresh=60000
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
All these
Moreover, they accept as first parameter the name of the database towards which we want to install/update/remove the triggers. Through this implementation, we can use these procedures in a cluster environment, by leveraging the cluster routing mechanism. These procedures are only executable by a user with admin permissions.
If this is not the case, the procedure throws an exception with the message |
Installing, updating or removing a trigger is an eventually consistent operation.
Therefore, they are not immediately added/updated/removed,
but they have a refresh rate handled by the Apoc configuration |
This example assumes that an apoc.trigger.install
has already been executed:
CALL apoc.trigger.show('neo4j');
name | query | selector | params | installed | paused |
---|---|---|---|---|---|
"count-removals" |
{} |
{} |
TRUE |
FALSE |