Should we use the Neo4J internal id?

守給你的承諾、 提交于 2019-12-17 17:09:42

问题


We are currently working with a Neo4j database, and we need some kind of id to identify nodes.

For example we have functions like CurrentUserHasAccess(NodeId)

On other Stackoverflow posts I read that it's a bad idea to use the internal neo4j-identifier, because it can change over time. However I think that's not an issue when we do not use this id to link data.

However I cannot seem to find any official sources about this topic.

I would like to use this ID because then we do not need to worry about uniqueness, and more importantly indexing.


回答1:


You are right that it is generally not recommended to use the internal Neo4j node IDs. This is mainly because if a node gets deleted, its original internal ID may get recycled/reused. If you're looking for a quick and elegant solution to this, have a look at the UUID module of the GraphAware Framework here https://github.com/graphaware/neo4j-uuid and let us know if it works for you.



来源:https://stackoverflow.com/questions/30753560/should-we-use-the-neo4j-internal-id

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!