这是我的csv文件的一个例子:
_id,official_name,common_name,country,started_by,
ABO.00,Association Football Club Bournemouth,Bournemouth,England,"{""day"":NumberInt(1),""month"":NumberInt(1),""year"":NumberInt(1899)}"
AOK.00,PAE Kerkyra,Kerkyra,Greece,"{""day"":NumberInt(30),""month"":NumberInt(11),""year"":NumberInt(1968)}"
我必须将此csv导入Neo4j:
LOAD CSV WITH HEADERS FROM
'file:///Z:/path/to/file/team.csv' as line
create (p:Team {_id:line._id, official_name:line.official_name, common_name:line.common_name, country:line.country, started_by_day:line.started_by.day,started_by_month:line.started_by.month,started_by_year:line.started_by.year
我收到错误( Neo.ClientError.Statement.InvalidType )设置started_by.day, started_by.month, started_by.year
如何正确设置有关started_by?
答案 0 :(得分:1)
csv的格式应该如下:
_id,official_name,common_name,country,started_by_day,started_by_month,started_by_year
ABO.00,Association Football Club Bournemouth,Bournemouth,England,1,1,1899
的Cypher:
LOAD CSV WITH HEADERS FROM 'file:///Z:/path/to/file/team.csv' as line
CREATE (p:Team {_id:line._id, official_name:line.official_name, common_name:line.common_name, country:line.country, started_by_day:line.started_by_day,started_by_month:line.started_by_month,started_by_year:line.started_by_year})
答案 1 :(得分:1)
看起来你的csv文件中的日期部分是JSON格式的 - 你不需要先解析它吗?
SELECT * FROM dbo.Product
是这个字符串
line.started_by
没有"{""day"":NumberInt(30),""month"":NumberInt(11),""year"":NumberInt(1968)}"