cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

How do i create different id for existing node?

CREATE (john:User {name:'John', gender:'M', age:'28'}) RETURN john

I used this command to create a User node and under that it has 3 properties

But the ID property is been generated by default

By default it is 0

But i want to change the ID property to 1?

How can i do that?

1 ACCEPTED SOLUTION

Hi @Jupyter123 - the ID is an internally generated, guaranteed-to-be-unique ID (I assume you're talking about https://neo4j.com/docs/cypher-manual/current/functions/scalar/#functions-elementid ). You cannot change it.

View solution in original post

2 REPLIES 2

Hi @Jupyter123 - the ID is an internally generated, guaranteed-to-be-unique ID (I assume you're talking about https://neo4j.com/docs/cypher-manual/current/functions/scalar/#functions-elementid ). You cannot change it.

ameyasoft
Graph Maven
Only way is to delete the node and create it again
MATCH (john:User) where john.name = "John"
DETACH DELETE john
CREATE (john:User {name:'John', gender:'M', age:'28'}) RETURN john