Skip to main content

export_util

docs-source

Abstract

Module for exporting a graph database in different formats. Currently, this module supports only the export to JSON file format.

TraitValue
Module typeutil
ImplementationPython
Parallelismsequential

Procedures

info

If you want to execute this algorithm on graph projections, subgraphs or portions of the graph, be sure to check out the guide on How to run a MAGE module on subgraphs.

json(path)

Input:

  • path: string ➡ Path to the JSON file containing the exported graph database.

Usage:

The path you have to provide as procedure argument depends on how you started Memgraph.

If you ran Memgraph with Docker, database will be exported to a JSON file inside the Docker container. We recommend exporting the database to the JSON file inside the /usr/lib/memgraph/query_modules directory.

You can call the procedure by running the following query:

CALL export_util.json(path);

where path is the path to the JSON file inside the /usr/lib/memgraph/query_modules directory in the running Docker container (e.g., /usr/lib/memgraph/query_modules/export.json).

info

You can copy the exported JSON file to your local file system using the docker cp command:

docker cp <container_id>:/usr/lib/memgraph/query_modules/export.json /path_to_local_folder/export.json

Example - Exporting database to a JSON file

Below you can see how the data looks like after you created the nodes and relationships: