brikteknologier / seraph

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

I want to provide my own object id while creating object #190

Closed rohandalvi closed 9 years ago

rohandalvi commented 9 years ago

If I provide id on db.save({id: 'someid' , name: object.name});

It returns error saying id doesn't exist. Well, I am trying to create a new object with id value of my choice. Isn't there any way to achieve this?

jonpacker commented 9 years ago

You need to move the internal id to a different property. You can do that by changing the id option when initializing seraph:

var db = seraph({
  id: 'internal_id',
  server: 'http://localhost:7474'
});

Now the internal id will be stored the the internal_id property and the id property will be free to use for your own purposes.