diff --git a/lib/adapters/neo4j.js b/lib/adapters/neo4j.js index b75c718a..f8202964 100644 --- a/lib/adapters/neo4j.js +++ b/lib/adapters/neo4j.js @@ -200,6 +200,8 @@ Neo4j.prototype.updateIndexes = function updateIndexes(model, node, cb) { Neo4j.prototype.save = function save(model, data, callback) { var self = this; + //delete id property since that's redundant and we use the node.id + delete data.id; this.node(data.id, function (err, node) { if (err) return callback(err); node.data = cleanup(data); @@ -207,6 +209,8 @@ Neo4j.prototype.save = function save(model, data, callback) { if (err) return callback(err); self.updateIndexes(model, node, function (err) { if (err) return console.log(err); + //map node id to the id property being sent back + node.data.id = node.id; callback(null, node.data); }); });