开发者

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

开发者 https://www.devze.com 2023-02-04 05:20 出处:网络
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

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 开发者_C百科use another format, such as UUIDs to identify each node?


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.


No, it's not.

[Stack Overflow requires 30 chars]


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消