How to disable the auto increment of the identifier (id) in Neo4j?

-1

I'm recently working with non-relational database, I'm using Neo4j. When generating the nodes with the attributes of the relational database, Neo4j does not allow it, since there is an auto increment of the ID, but I need the ID attribute of the relational database to be included, since I will make the relationships based on this information. p>     

asked by anonymous 17.05.2017 / 14:23

1 answer

0

It is not possible to disable the auto increment of the node IDs in Neo4j. In fact, the IDs generated automatically by Neo4j are for internal use of the database. These IDs are even reused by the database when a node or relationship is deleted, as you can see . This way, we can not "trust" or depend on this ID.

Nothing prevents you from creating your own ID property and use this ID to make your queries / updates from us. For example, when running CREATE (:User {id:1}) you are creating a node with a :User label and a igual to 1 property. This ID has nothing to do with the internal ID managed by Neo4j, so much so that to access it in a WHERE just make WHERE node.id = 1 , whereas to use the internal ID of Neo4j you would need to use the ID ( WHERE ID(node) = 1 ).

    
19.05.2017 / 03:33