This is more of a database management question. I'm not trying to extract content stored in properties, but I am trying to clean up a messy database.
For example, I have multiple obsolete properties that start with "type", for example n.typePerson, n.type_Mangoes, n.typehouse, n.dvdTypes.
match (n)
with keys(n) as key, n
unwind key as k
with distinct k, n
WHERE tolower(k) contains "type"
with n, k
return k, n[k]
--> works fine
REMOVE n[k] return n{.*}
--> error message
WITH distinct n, collect(k) as list
FOREACH (o IN list | REMOVE n[o])
return n{.*}
--> error message
I'm hitting a wall when it comes time to do anything with the property. I can return n[k] fine, but I cannot seem to set or remove n[k] without getting this error:
Neo.ClientError.Statement.SyntaxError: Invalid input '[': expected an identifier character, whitespace, node labels, '{', 'e/E', a property map, a relationship pattern, '.' or '(' (line 7, column 9 (offset: 136))
"REMOVE n[o]"
Most grateful for pointers. Thanks!
question from:
https://stackoverflow.com/questions/65849630/dynamic-property-keys-used-in-cypher-query-to-manipulate-properties-regardless 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…