Two question

for Neo4j enterprise :

  1. How to automatic generate id ?
  2. How to make general Uniqe constraints ?
  1. apoc.create.uuid() or Graphaware UUID (GitHub - graphaware/neo4j-uuid: GraphAware Runtime Module that assigns a UUID to all nodes (and relationships) in the graph transparently)

2.Constraints - Cypher Manual

thanks you for reply.
apoc.create.uuid() The string is a guid.
Does it create problems for performance?
I must create a unique id number-based?

do you mean sequence number, as a node property for the data ?

Yes. for node propery id

If you want to have integer based number that mimics a row_number for distinct elements you could do something like:

Match (n:User) with n limit 10 with,length(collect(n))),collect(n)) as pairs unwind pairs as pair return pair

Now you could take pair[0] and set it as a property on pair[1]

In general we would not recommend using a Cypher solution to implement a sequence id, as you'd likely run into race conditions against concurrently running queries. We'd recommend sticking with a UUID instead.

Keep in mind that one huge case for sequence IDs in SQL is as foreign keys between tables to relate entries to each other, and this isn't needed in Neo4j as we use relationships instead, which are not dependent upon these (they are dependent upon the graph ids Neo4j automatically assigns to nodes, but these are not guaranteed to be sequential, as they can be reused after node deletion, and that same characteristic can make them a bad fit for saving outside of Neo4j as a means of node lookup).

thanks you.
i am trying to learn new