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.

Not able to delete Graph Node

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

2 REPLIES 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.

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.