Neo4j does not recommend to use node id to store in third party system for later referencing.
Now Cypher has a randomUUID
native function, see https://neo4j.com/docs/cypher-manual/current/functions/scalar/
It is true that you should not reference an internal id in an external system as internal ids are not stable.
One option for generating a UUID would be using the apoc.create.uuid
function available in the apoc procedure library. For example:
CREATE (p:Person)
SET p.name = "Bob",
p.uuid = apoc.create.uuid()
See this blog post for more information on user defined procedures and functions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With