Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Neo4j/Cypher Delete with Where "Unknown identifier"

Tags:

neo4j

cypher

I've made the mistake of being inconsistent with attribute types. For nodes of type "person", some have a string for the "external_id" property, and some have an int. I'd like to delete all nodes where the property is a string. The following query runs and seems to give a correct answer.

MATCH (n:person)
WHERE TOSTRING(n.external_id) = n.external_id
RETURN count(n)

However, when I try to delete those nodes using the following query, I get "Unknown identifier `n`.":

MATCH (n:person)
WHERE TOSTRING(n.external_id) = n.external_id
DELETE n

I'm new to Neo4j and Cypher, but this seems like it should be pretty straightforward. I've already deleted all of the relationships for these nodes. What am I missing here?

like image 306
Ross G Avatar asked Nov 08 '22 22:11

Ross G


1 Answers

This is a duplicate of https://github.com/neo4j/neo4j/issues/5768 which was fixed by https://github.com/neo4j/neo4j/pull/5807

like image 159
Olivia Ytterbrink Avatar answered Dec 30 '22 10:12

Olivia Ytterbrink