Getting started

Neo4j v5 and APOC

What happened with APOC in Neo4j v5?

Have you recently updated to Neo4j v5, and discovered that certain APOC procedures you rely on are no longer functioning? Or you have just deployed a v5 database, installed APOC-extended and discovered that it’s not working as it was before with APOC-all? You’re not the only one experiencing this.

With the release of Neo4j v5, APOC has been divided into two editions. The primary distinction lies in the fact that some procedures are now officially supported and accessible in the APOC-core edition, which is the only edition supported by Neo4j. APOC-core consists of well-tested procedures and functions that do not rely on external dependencies. On the other hand, the APOC-extended edition includes extra procedures that may necessitate external dependencies, it is maintained by community and is not officialy supported by Neo4j.

Docs and differences

There are now two different documentation pages for the two editions:

There are also two different repositories for Core and Extended, compared to before where you had both core and all in same repository. The links to respective repos:

Furthermore, each procedure in the documentation is labeled with an “Extended” tag if it does not belong to the Core edition. For example, the apoc.load.json procedure is part of the Core edition as it doesn’t have the Extended tag. On the other hand, the apoc.load.csv procedure is part of the Extended edition, as indicated by the Extended tag.

changes-apoc

Installation

To install APOC-core, first you’ll need to ensure that the APOC-core version you’re installing is compatible with your version of the database. For example, if your database version is 5.12.1, you need to find APOC version that matches the major and minor version of your database version, otherwise the database will fail to start, and you will see details around it in database logs. So in our example, you would look for APOC-core 5.12.x, because patch version doesn’t need to match the database patch version.

In the above section we provided links to the respective repositories where you can find the .jar files to download.

ℹ️Keep in mind that you should always install Core edition and if needed, you would install the Extended edition as well, depending on the additional procedures or functions you need.

Please navigate to the database interface, Plugins tab > + Add Plugins button and you’ll be prompted to add a name to the plugin and upload a .jar file you’ve downloaded. You can find more info here on how to upload the Plugin.

To check that APOC is correctly installed and to get a comprehensive list of all the procedures, you can execute CALL apoc.help('apoc') from your Neo4j Browser, and you can also provide some filtering if you want to.

APOC plugin configuration

Another thing that has changed is that we cannot add APOC configuration setting to the neo4j.conf file. Instead, it needs to go into apoc.conf file and set any APOC configuration values there. you can add a configuration to a plugin, if you need special configuration. The apoc.conf file is not created automatically when installing the APOC plugin, so in order to request a file to be created, simply Open a Support Case with a title and description, and we will be happy to enable it for you.

Once enabled, you will see in the Plugins tab of the database in question, the plugins APOC Configuration section, where you will be able to manage it yourself.

plugins-conf

How to add special Plugins configuration?

Please go to database where you need special plugins configuration added > Plugins tab. Scroll to the plugins APOC Configuraton section and click on Add Configuration button.

add-plugins-conf

You’ll be prompted to add a Configuration Key and Configuration Value. Please note that not all configurations are allowed. You can check the allowed configurations here. Once you’re happy, please click on Confirm button.

ℹ️ Info The Database needs to be restarted for changes to be applied. This will result in a short downtime, which will depend on the time that the process needs to stop and start your database.

How to delete special Plugins configuration?

To delete the added configuration, simply click on transhcan icon on the right-hand side next to the special configuration. You’ll be prompted to a modal window where you need to click on Confirm button to complete the action.

delete-plugins-conf

Saving memory

The APOC library contains numerous procedures and functions and it requires a big amount of memory when loading all the procedures, therefore it’s advised against loading all of them into the DBMS. Rather, it’s preferable to adhere to the principle of least privilege. This principle stipulates that only the procedures and functions essential for executing the user’s workload should be loaded.

You can specify the procedures and functions that should be loaded using the database configuration setting dbms.security.procedures.allowlist, which is located in the conf/neo4j.conf file. GrapheneDB allows you to manage the configuration of Neo4j as it is done via neo4j.conf file, but currently dbms.security.procedures.allowlist is not whitelisted, so please reach out to us so that we can help, and you can do so by opening a Support Case.

For more information around this, please refer to official Neo4j docs.

Try out today and get $50 in CreditsTry out today and get $50
Check
Evaluate for free
Check
Pay as you go
Check
No hidden costs