Skip to content

Instantly share code, notes, and snippets.

@Pompeu
Created October 24, 2014 02:54
Show Gist options
  • Save Pompeu/e82258c950b0a0a92f3a to your computer and use it in GitHub Desktop.
Save Pompeu/e82258c950b0a0a92f3a to your computer and use it in GitHub Desktop.
NeoJ
var neo4j = require('neo4j');
var db = new neo4j.GraphDatabase('http://localhost:7474');
var node = db.createNode({hello: 'world'}); // instantaneous, but...
node.save(function (err, node) { // ...this is what actually persists.
if (err) {
console.error('Error saving new node to database:', err);
} else {
console.log('Node saved to database with id:', node.id);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment