Reliable (auto)incrementing identifiers for all nodes/relationships in Neo4j
问题 I'm looking for a way to generate unique identifiers for all my nodes/relationships in Neo4j, based on an incrementing counter (not big long uuids). The internal ids maintained by the Neo4j engine are known not to be reliable as outside references. A solution that comes close is the code proposed in this question, but it doesn't work when a single CREATE clause creates multiple new nodes: // get unique id MERGE (id:UniqueId{name:'Person'}) ON CREATE SET id.count = 1 ON MATCH SET id.count = id