Auto Increment in Neo4j

痞子三分冷 提交于 2019-12-12 14:17:38

问题


Is there a way to set an auto_increment just like you would in MySQL for Neo4j? For example, I want nodes to start with numbers like 1000000000 when I create them with the GraphDatabaseService object. Thank you very much.


回答1:


Checkout this answer: Can I create a node in neo4j with specified id?

The ID that Neo4J assigns each object different than the PK assigned to a row in a database. the location in the Node index is reflected in the ID that Neo4J assigns. In a Relational Database the value is simply a unique and indexed key that you can look up against. A cleaner approach would be to create a arbitrary Index value as a Node property and Index it (so you can do quick look ups against it).



来源:https://stackoverflow.com/questions/11836838/auto-increment-in-neo4j

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