brikteknologier / seraph

A thin and familiar layer between node and neo4j's REST api.
MIT License
309 stars 59 forks source link

Can't create node with a label in a single call #185

Closed swist closed 8 years ago

swist commented 9 years ago

I am trying to create a company with a label in a single db.save call, but I get neo4jError:NullPointerException

my code is:

db.save({name: "test"}, "Company", function(err, node){
    console.log(err, node);
}); 

When I use a db.label in the callback it works:

db.save({name: "test"}, function(err, node){
    db.label(node, "Company", function(err, node){
        console.log(err, node);
    });
}); 

Is this the expected behaviour? The documentation suggests that the first option should be possible.

jonpacker commented 9 years ago

I can't seem to replicate. Which version of neo4j are you using? Here's what happens for me:

 var s = require('./lib/seraph')
undefined
> var db = s()
undefined
> db.save({name:'Test'}, 'Company', function(err, node) { console.log(err, node) })
undefined
> null { name: 'Test', id: 4567 }
jonpacker commented 8 years ago

Please reopen if you have some steps to replicate!