I'm just importing some stuff from .csv file to Neo4j. I've always used MERGE to create a node, but now, when trying to import from .csv, some of data is null, e.g. column address. When I'm doing MERGE instead of CREATE it gives an error, but when I do CREATE it works fine. The only difference I know between MERGE and CREATE is that if the node already exists, MERGE doesn't make a new one.
My query:
LOAD CSV WITH HEADERS FROM '<path>' as line
CREATE (a: Address
{
address: line.address,
postalCode: toInteger(line.postalCode),
town: line.town,
municipalityNr: toInteger(line.municipalityNr),
municipality: line.municipality,
countryCode: line.countryCode,
country: line.country
})
RETURN a.address