LinuxCommandLibrary

neo4j

TLDR

Start Neo4j server

$ neo4j start
copy
Stop server
$ neo4j stop
copy
Check status
$ neo4j status
copy
Run as console (foreground)
$ neo4j console
copy
Open Cypher shell
$ cypher-shell
copy
Set initial password
$ neo4j-admin dbms set-initial-password [password]
copy

SYNOPSIS

neo4j command [options]

DESCRIPTION

Neo4j is a native graph database platform for connected data. It uses the Cypher query language and stores data as nodes and relationships.
Neo4j excels at queries involving complex relationships that would require expensive joins in relational databases.

PARAMETERS

start

Start server in background.
stop
Stop server.
restart
Restart server.
status
Check server status.
console
Run in foreground.

CYPHER EXAMPLES

$ // Create node
CREATE (n:Person {name: 'Alice'})

// Create relationship
MATCH (a:Person), (b:Person)
WHERE a.name = 'Alice' AND b.name = 'Bob'
CREATE (a)-[:KNOWS]->(b)

// Query
MATCH (n:Person)-[:KNOWS]->(m)
RETURN n.name, m.name
copy

CONFIGURATION

$ /etc/neo4j/neo4j.conf
~/.neo4j/neo4j.conf
copy

CAVEATS

Memory-intensive for large graphs. Community edition single-node only. Requires Java. Default browser UI on port 7474.

HISTORY

Neo4j was developed by Neo4j, Inc. (originally Neo Technology), with version 1.0 released in 2010. It pioneered the property graph model.

SEE ALSO

Copied to clipboard