0
votes

I'm quite new to neo4j. I'm developing a web app(using express.js and async) that does a POST request, which in turn creates a triangle of nodes and relationships. So, there are 6 queries and I want to use auto-increment ID (or rowID) of the created nodes (using id(a)) to create relationships.

As I saw in another post(Node identifiers in neo4j), rowID should not be relied for reuse. But, I have no other way of identifying my nodes (unless if I create an index on all the properties which is a pain).

Hence, my question, can I use rowID for this use-case ? If not, what kind of use case suits better for rowID ?

2

2 Answers

2
votes

If you only need an id to create the triangles, then you can use id(n), but probably you can just create the triangle with a single cypher statement.

Perhaps you can share more of your code/domain?

Usually you should have a business-key / -id that you can use.

2
votes

Create your own id and store it on the node as a property, if you have no unique id that you can use.