Imports object structures generated by MongoDB object relation mappers (like Mongoose) into Neo4j for exploration with SemSpect
Project description
mongo2neo4j
MongoDB Mongoose to Neo4j Importer
What is mongo2neo4j?
Imports object relations generated by Object Relation Mappers (ORMs) like Mongoose and stored in MongoDB into the graph database management system Neo4j for exploration with the no-code graphical querying tool SemSpect. Further relations between objects can be specified via options.
What for?
Imagine you just released your latest MEAN-stack app and want to learn how it is used. You could write some MongoDB queries to find out "how many users of the free tier are at all producing some data?", "which feature is used most by subscribers?", ... But maybe you never find time to write those queries or you do not know exact what to look for. A graphical large-data exploration tool like SemSpect comes in handy, which allows you to discover patterns in your data by simple navigation.
As SemSpect is layered on top of the graph database system Neo4j as graph app, your MongoDB data needs first to be established in Neo4j. This can be easily achieved using the mongo2neo4j
tool.
How does it work?
The mongodb2neo4j
script creates a label (class of nodes) in Neo4j for each collection in the given MongoDB and adds nodes in Neo4j for all documents. Cross-references between MongoDB documents using unique ObjectId
identifiers are turned into Neo4j relations, nicely rendered by SemSpect.
Installation
Install Neo4j
The free Neo4j Desktop works well (see Neo4j)
Install SemSpect Plugin
The free SemSpect Graph App for Neo4j works well (see SemSpect)
Install mongo2neo4j
Note: mongo2neo4j requires Python 3.11 or newer.
% pip3 install mongo2neo4j
Run the importer
You can run the mongo2neo4j
importer from the shell by providing at least the name of the MongoDB DB the data should be imported from. If not specified the default neo4j
DB is targeted with the default neo4j
user. It is likely that you will have to add passwords.
% mongo2neo4j \
[--mongo_host mongodb://<mongo_user>:<mongo_password>@<mongo_host>] \
[--neo4j_user=<neo4j_user>] [--neo4j_password=<neo4j_password>] \
<mongo_db>
Further configuration options are listed on calling
% mongo2neo4j -h
See Script Arguments for the full list of available arguments and the example documenting the workflow of mongo2neo4j using randomly generated sample data.
NOTE: if the APOC plugin is installed in the Neo4j DB, the faster and memory-effective apoc.periodic.iterate
method is used to generate nodes and sublabels.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for mongo2neo4j-1.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b612b1d797347e15e795d8004e32780d8fd9dd72a6f8bd36d7c465fa266dd352 |
|
MD5 | b6c3c438201d7005e9dfde8af2e573d0 |
|
BLAKE2b-256 | 5a9f6600432786fc9462d183830971258914ea78cd1ea28f0e336b538dfec34c |