apoc.convert.toTree removed

Hello,

I am trying to use Neo4j for a specific use case, where I have recursive hierarchical dependencies (Think Folders and Sub Folders).

I would like to select the whole chains of relations and return them in a nested Json.

Actually I have already achieved this with apoc.convert.toTree():

match path = (folder: Folder)-[:CONTAINS*]->() where not ()-[:CONTAINS]->(folder)
with collect(path) as paths
CALL apoc.convert.toTree(paths)
YIELD value
RETURN value;

My Problem: This procedure seems to be only available in Neo4j 4.

I am using the neo4j:4.1.10-community docker image and APOC apoc-4.1.0.11-all.jar.

I would like to use it with Neo4j 5, because I am new to Neo4j and it feels weird, when I have to use an old version to get my target Functionality.

I have tried the neo4j:5.21.2 image with this env: NEO4J_PLUGINS: '["apoc-extended"]', which results in a apoc-extended.jar. Maybe I am missing something? Is there an apoc-full jar for Neo4j 5? Or was that procedure moved to some other plugin?

I am running Neo4j from the browser explorer and develop/test locally through docker with docker-compose

It looks like it is in the core jar.

1 Like

Yes, using the apoc-5.22.0-core.jar from the GitHub Realeses works now in Neo4j 5.

Interesting, that the documentation mentions, how the library can be installed from the /labs folder in the Docker Image, but that Version does not contain the whole core (as it seems).

I will close this, since it is working with the manually downloaded version. Thank you very much.

1 Like