Skip to content
neode 1.0 alpha

An OGM is the part of your graph code you stop re-writing.

An object-graph mapper turns models into Cypher and records back into typed objects. You still get a graph. You lose the string-building, the unwrapping, and the schema bookkeeping.

Create one person.

neo4j-driver · hand-written
const session = driver.session()
const result = await session.run(
  'CREATE (p:Person { id: randomUUID(), name: $name, age: $age }) RETURN p',
  { name: 'Adam', age: 30 }
)
const adam = result.records[0].get('p').properties
// age comes back as a driver Integer, not a number
You also own: the uniqueness constraint, the length check on name, closing the session, and every query like this one.
neode
const adam = await neode.create(Person, { name: 'Adam', age: 30 })
Validation runs first, the constraint comes from the model, and you get a typed Person back.

One query per read.

Hydrating a movie and its cast by hand usually means one query for the movie and one more per related node. Eager loading and read-model decorators fold all of it into a single statement.

hand-rolled · 1 + N round trips
app
graph

Every extra edge to hydrate is another trip. Latency grows with the size of the answer.

neode · 1 statement
app
graph

@RelatedOne, @RelatedMany, @RelationshipCount, @Computed and @Expression all project into the same statement.

Errors you can switch on.

A typed taxonomy instead of parsing driver messages. Validation failures arrive together, before anything reaches the database.

ConstraintViolationError
A unique or exists constraint said no. Note that exists constraints need Neo4j Enterprise.
TransientError
Carries retryability flags, so a retry loop does not guess.
OptimisticLockError
Raised on a stale write when a model uses @Version.

A migration workflow for your schema.

Your models declare constraints and indexes. neode compares them with what is installed and walks you from one to the other.

1
installSchema()
Create constraints and indexes from your models.
2
inspectSchema()
Diff what is declared against what is installed.
3
schemaDrift()
List the differences as data.
4
formatSchemaDrift()
Render them for a person to review.
5
applySchemaDrift()
Bring the database in line.
Open the playground Migration guide