I'm trying to load csv file into neo4j using this query:
:auto
USING PERIODIC COMMIT
LOAD CSV WITH HEADERS FROM 'file:///test.csv' AS row
MERGE (news:newsID {newsID: row.id})
ON CREATE SET
news.title = row.title,
news.creation_date = row.creation_date,
news.content = row.content;
I want to convert creation_date
to datetime
I can do that using something like:
WITH apoc.date.parse("2019-3-8 12:10:11", "ms", "yyyy-MM-dd HH:mm:ss") AS ms
RETURN datetime({epochmillis: ms}) as cdate
But I can not use it in the LOAD CSV
set part.
How can I convert a field using apoc.date.parse
and datetime in LOAD CSV
?