Reputation: 905
I have relational DB with entities with own id's. Is it possible to use these id's when saving nodes to Neo4j? Right now, when id is set, object is not being saved.
Upvotes: 1
Views: 500
Reputation: 622
It's best to let SDN (which in turn relies on Neo4j under the covers) to generate the entity's id, particularly given that this graph id is internal to Neo4j and is generally recommended not to be used outside of the graph.
When you mention to your relational DB, I assume you are referring to the use case of migrating existing data in the relational database to Neo4j. In this case, you could take the approach of letting Neo4j generate and manage the graph id and then assign the relational DB entity id to the node, under a key of "externalSourceId", for example. That way you have the best of both worlds: a native graph id managed by Neo4j and a property holding your originating relational id.
Upvotes: 1