Not able to delete Graph Node


(Ashishbhardwaj 2010) #1

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

"hallo@edare.net"
"support@edare.net"
null
"admin@edare.net"
"development@edare.net"

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


(Michael McKenzie) #2

You could also try:

MATCH (u:User)
WHERE u.email IS NULL
DETACH DELETE u

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.


(Andrew Bowman) #3

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.