Neo4j: possible to create an alternative to node ids based on integer increments?

StackOverflow https://stackoverflow.com/questions/4702432

  •  11-10-2019
  •  | 
  •  

Question

Neo4j's nodes tend to be set on the basis of integer increments. I can see this having issues in an application that needs to merge multiple two databases. Is it possible to configure the database to use another format, such as UUIDs to identify each node?

Was it helpful?

Solution 2

No, it's not.

[Stack Overflow requires 30 chars]

OTHER TIPS

What I have done before is set a property on each node to store a GUID and created an index using the IndexService that creates a GUID index. I have then worked with that index to retrieve nodes based on GUID rather than the internal Neo4J generated ids.

Here is a neo4j extension that adds uuid properties to each node.

https://github.com/sarmbruster/neo4j-uuid

Quote from the author why you should use uuid if you are dealing with multiple database:

... node.getId() is a bad choice since after deletion of a node its id might be recycled.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top