Configuration Options

Location of config options

APOC for 4.0 introduces new configuration management. All config options from Reference of config options can be provided either in:

environment variables

set them either via export key=val or via --env settings when used for docker.

system properties

best to use via dbms.jvm.additional form conf/neo4j.conf

conf/apoc.conf

located side-by-side with conf/neo4j.conf using the very same property style notation

The order of this table matches their config option precedence. E.g. any env setting will orverride options set in apoc.conf.

APOC internally relies on Apache commons-config for resolving config settings. The meta-configuration is located in src/main/resources/apoc-config.xml.

Reference of config options

Set these config options in $NEO4J_HOME/conf/apoc.conf, via system properties or environment variables.

All boolean options have the default value set to false. This means that they are disabled, unless mentioned otherwise.

Property Description

apoc.couchbase.<key>.uri=couchbase-url-with-credentials

store couchbase-urls under a key to be used by couchbase procedures

apoc.es.<key>.uri=es-url-with-credentials

store es-urls under a key to be used by elasticsearch procedures

apoc.export.file.enabled=false/true

Enable writing local files to disk

apoc.http.timeout.connect=<number> (default 10000)

Sets a specified timeout value, in milliseconds, to be used when communicating with a URI. If the timeout expires before the connection can be established, a Neo.ClientError.Procedure.ProcedureCallFailed exception is raised. A timeout of zero is interpreted as an infinite timeout.

apoc.http.timeout.read=<number> (default 60000)

Sets the read timeout to a specified timeout, in milliseconds. A non-zero value specifies the timeout when reading from a connection established to a resource. If the timeout expires before there is data available for read, a Neo.ClientError.Procedure.ProcedureCallFailed exception is raised. A timeout of zero is interpreted as an infinite timeout.

apoc.import.file.enabled=false/true

Enable reading local files from disk

apoc.import.file.use_neo4j_config=true/false (default true)

the procedures check whether file system access is allowed and possibly constrained to a specific directory by reading the two configuration parameters dbms.security.allow_csv_import_from_file_urls and dbms.directories.import respectively

apoc.initializer.cypher

a cypher statment to be executed once the database is started

apoc.initializer.cypher.<key>

multiple cypher statements to be executed once the database is started

apoc.jdbc.<key>.uri=jdbc-url-with-credentials

store jdbc-urls under a key to be used by apoc.load.jdbc

apoc.jobs.scheduled.num_threads=number-of-threads (default: number of CPU cores / 4)

Many periodic procedures rely on a scheduled executor that has a pool of threads with a default fixed size. You can configure the pool size using this configuration property

apoc.jobs.pool.num_threads=number-of-threads (default: number of CPU cores * 2)

Number of threads in the default APOC thread pool used for background executions.

apoc.jobs.queue.size=size of the queue (default: value of apoc.jobs.pool.num_threads * 5)

Size of the queue ThreadPoolExecutor working queue

apoc.mongodb.<key>.uri=mongodb-url-with-credentials

store mongodb-urls under a key to be used by mongodb procedures

apoc.spatial.geocode.provider=<providername> apoc.spatial.geocode.<providerName>.<key>=<value>

configuration for geocoding providers, keys and values are provider specific, see [spatial]

apoc.trigger.enabled=false/true

Enable triggers

apoc.ttl.enabled=false/true

Enable time to live background task

apoc.ttl.enabled.<name_db>=false/true (default true)

Enable time to live background task for a specific db. Please note that this key has to be set necessarily in apoc.conf. If is true TTL is enabled for the db even if apoc.ttl.enabled is false, instead if is false is disabled for the db even if apoc.ttl.enabled is true

apoc.ttl.schedule=<secs> (default 60)

Set frequency in seconds to run ttl background task

apoc.ttl.schedule.<name_db>=<secs> (default 60)

Set frequency in seconds to run ttl background task for a specific db. It has priority over apoc.ttl.schedule. Please note that this key has to be set necessarily in apoc.conf.

apoc.ttl.limit=<number> (default 1000)

Maximum number of nodes being deleted in one background transaction, that is the batchSize applied to apoc.periodic.iterate() during removing nodes

apoc.ttl.limit.<name_db>=<number> (default 1000)

Maximum number of nodes being deleted in one background transaction for a specific db, that is the batchSize applied to apoc.periodic.iterate() during removing nodes for a specific db. It has priority over apoc.ttl.limit. Please note that this key has to be set necessarily in apoc.conf.

apoc.uuid.enabled=false/true (default false)

global switch to enable uuid handlers

apoc.uuid.enabled.<name_db>=false/true (default true)

Enable/disable uuid handlers for a specific db. Please note that this key has to be set necessarily in apoc.conf. If is true UUID is enabled for the db even if apoc.uuid.enabled is false, instead if is false is disabled for the db even if apoc.uuid.enabled is true