问题
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