Changing server from follower to leader

I'm trying to create a trigger with https://neo4j.com/labs/apoc/4.4/overview/apoc.trigger/apoc.trigger.install/

however when i try to create it, it gives me the following msg:
"Failed to invoke procedure apoc.trigger.install: Caused by: java.lang.RuntimeException: No write operations are allowed directly on this database. Writes must pass through the leader. The role of this server is: FOLLOWER"

i run neo in docker but there is only 1 neo4j server.
how do i change from follower to leader?

Make sure using neo4j:// URL scheme when connecting to the DB. If using via a driver, ensure your sending the apoc.trigger.install in a write transaction.

using neo4j:// URL did not work.
not sure what you mean with "sending the apoc.trigger.install in a write transaction". My code is in the following format

CALL apoc.trigger.install('DBNAME',
'TRIGGERNAME', 'QUERY',
{phase: "before"}
);

starting the query with "USE system" did the job

1 Like