Not able to delete Graph Node

I have User node. When i am executing query MATCH (u:User) return


There is null node. I am not able to delete it .
Even i am trying to delete it by ID with this query
match (n) where id(n)=1251116 detach delete n

You could also try:

MATCH (u:User)

The above code will be more generic to delete any nodes that meet that criteria.

However, I believe the issues is that you are asking where id(n) is equal to an integer, when you want it to be equal to a string:
match(n) where id(n)="1251116" detach delete n
Note the quotations around the number to denote it as a string.

A node's id (using id(n)) will always be an integer (64-bit long value under the hood), not a string, so I don't think quotations are part of the solution here.

1 Like