Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Quick Start

Two five-minute paths: the embedded CLI, and the server.

Embedded (CLI)

The CLI opens a database directory directly — no server.

# Create data (the directory is created on first use)
patinadb ./demo query \
  "CREATE (a:Person {name: 'Ada', born: 1815})-[:KNEW]->(b:Person {name: 'Charles'})"

# Read it back
patinadb ./demo query \
  "MATCH (a:Person)-[:KNEW]->(b) RETURN a.name, b.name"

# As JSON
patinadb ./demo query "MATCH (n:Person) RETURN n" --json

# What changed, and when?
patinadb ./demo log          # list engrams
patinadb ./demo diff <id>    # git-style view of one change

See Command-Line Interface for every subcommand.

The server

Start a single self-leading node (quorum of 1 — no peers needed):

docker run -p 21001:21001 -p 7687:7687 -v "$PWD/serverdata:/data" \
  patinadb/patinadb --auth-user neo4j --auth-password secret

(Or run the patinadb-raft binary directly the same way if you have it installed on the host: patinadb-raft --id 1 --addr 127.0.0.1:21001 --db ./serverdata --bootstrap --auth-user neo4j --auth-password secret.)

This exposes:

  • REST on 127.0.0.1:21001POST /cypher
  • Bolt on 127.0.0.1:7687 — for Neo4j drivers and the Browser

Query over REST:

curl -s -u neo4j:secret -X POST 127.0.0.1:21001/cypher \
  -H 'content-type: application/json' \
  -d '{"query": "CREATE (n:Person {name: \"Ada\"}) RETURN n"}'

Connect the Neo4j Browser (browser.neo4j.io) to bolt://localhost:7687 with user neo4j / password secret, and run Cypher interactively — including graph visualisation of returned nodes and paths.

Connect an official driver (Python shown):

from neo4j import GraphDatabase
drv = GraphDatabase.driver("bolt://localhost:7687", auth=("neo4j", "secret"))
with drv.session() as s:
    for rec in s.run("MATCH (n:Person) RETURN n.name AS name"):
        print(rec["name"])

From here: