I am trying to load data using the load csv. syntax might be wrong here.
<USING PERIODIC COMMIT 100 LOAD CSV WITH HEADERS FROM "file:///myfile.csv"
as eachline FIELDTERMINATOR ,
WITH eachline
"MATCH(r:Record) where r.Id contains eachline.Id
set r.Name=eachline.Id , r.EmailId=eachline.email , r.lastName=eachline.id />
Sample query above.
Here i want to SET/update the e.EmailId only if the value is present.
it may happen that email is updated and it is not present in the record next time when csv is generated. in that case i want to ignore the record and not set with empty field and update other fields.
could the ignoreme be used here?
Thanks for your email..!!
i can not go with the first one... but will try then next one..
here will it work if the eachline.email is updated with any new value instead of null/empty.
will it consider and update the new one? I will try as well. Thanks
also seems like coalesce will work to check if its null and not empty..
Example:
First load sets r.EmailId=abc.com from csv eachline.email
Next load of csv say eachline.email = " " , ignore update to this field(r.EmailId) as its empty. so set - r.EmailId= abc.com instead of " " and only update other fields on node.
Next load if csv file has eachline.email="xyz.com" then set existing r.EmailId to eachline.email(xyz.com)