Cypher - delete all properties with a specific value

I am looking for a way to remove each property from any node in the database, having a specific value using Cypher.

Context
I got a csv bulk file from a relational table with lots of NULL values. LOAD CSVbrings them as values. Removing them (replacing them with an empty "in the csv file") led to the same problem (properties without values). I tried many (many) Cypher operations to drop NULL values, but nothing worked.

Unable to find anything in documents other than Googling. Can this be done using only Cypher? It seems to me that (so far) is not supported.

Thank.

+4
source share
2 answers

( ):

MATCH (n:Label)
WHERE n.property = ''
REMOVE n.property;

MATCH (u:User) 
WHERE u.age = '' 
SET u.age = null;

, , -

load csv with headers from "" as line
with line, case line.foo when '' then null else line.foo end as foo
create (:User {name:line.name, foo:foo})

.

, toInt() toFloat() null , '..

+4

, chypher. , REST. .

0

Source: https://habr.com/ru/post/1546532/


All Articles