This driver has undergone a complete rewrite for Neo4j v2. It now only supports Neo4j 2.x — but it supports it really well. (If you're still on Neo4j 1.x, you can still use node-neo4j v1.)
Neo4j is a transactional, open-source graph database. A graph database manages data in a connected data structure, capable of representing any kind of data in a very accessible way. Information is stored in nodes and relationships connecting them, both of which can have arbitrary properties. To learn more visit What is a Graph Database?
npm install neo4j --save
var neo4j = ;var db = '';db;
If you're having any issues you can first refer to the API documentation.
If you encounter any bugs or other issues, please file them in the issue tracker.
We also now have a Google Group! Post questions and participate in general discussions there.
You can also ask a question on StackOverflow
|Version||Ver 1.x||Ver 2.x|
|Feature||Ver 1.x||Ver 2.x|
|Embedded JVM support||No||No|
Node.js is asynchronous, which means this library is too: most functions take callbacks and return immediately, with the callbacks being invoked when the corresponding HTTP requests and responses finish.
Because async flow in Node.js can be quite tricky to handle, we strongly recommend using a flow control tool or library to help. Our personal favorite is Streamline.js, but other popular choices are async, Step, Seq, TameJS and IcedCoffeeScript.
Once you've gotten the basics down, skim through the full
API documentation to see what this library can do, and take a
look at @aseemk's node-neo4j-template app for a complete usage
models/User.js file in particular is the one that interacts
with this library.)
This library is officially stable at "v1", but "v2" will almost certainly have
breaking changes to support only Neo4j 2.0 and generally improve the API
(roadmap). You can be sheltered from these changes if you simply specify
your package.json dependency as e.g.
^1.0 instead of
git clone firstname.lastname@example.org:thingdom/node-neo4j.git cd node-neo4j npm install && npm run clean
You'll need a local installation of Neo4j (links),
and it should be running on the default port of 7474 (
To run the tests:
This library is written in CoffeeScript, using Streamline.js syntax.
The tests automatically compile the code on-the-fly, but you can also generate
.js files from the source
._coffee files manually:
npm run build
This is in fact what's run each time this library is published to npm.
But please don't check the generated
.js files in; to remove:
npm run clean
.js files exist, changes to the source
._coffee files will
not be picked up automatically; you'll need to rebuild.
npm link this module into another app (like node-neo4j-template)
and you want the code compiled on-the-fly during development, you can create
index.js file under
lib/ with the following:
;;moduleexports = ;
But don't check this in! That would cause all clients to compile the code on-the-fly every time, which isn't desirable in production.
See the Changelog for the full history of changes and releases.
This library is licensed under the Apache License, Version 2.0.