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?
ameyasoft
( Ameyasoft)
December 14, 2022, 4:52pm
2
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
john.stegeman
(John "Steggy" Stegeman)
December 14, 2022, 12:27pm
3
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.