i am still new to neo4j, so i am trying to load this csv file and i want to be able to get the same result as when I use the foreach clause but using apoc functions, although I am still learning the apoc functions, meanwhile using the foreach clause works very fine, but upon using the apoc function I get this error!
"Type mismatch: expected String but was Map (line 8, column 5 (offset: 335)) " {csvline:csvline}"
can some one please help me out ? thanks in advance ~!!
foreach:
:auto using periodic commit
load csv with headers from 'file:///E\_Directory\_Export.csv' as csvline fieldterminator ';'
with csvline
foreach (IgnoreMe in (CASE when csvline.Team is null then \[\] else \[1\] end) |
merge (team: c\_team {identifier: csvline.Team})
set team.name = csvline.Team
)
can someone please tell me what I am doing wrong here,
:auto using periodic commit
load csv with headers from 'file:///E\_Directory\_Export.csv' as csvline fieldterminator ';'
with csvline
optional match (team: c\_team {identifier: csvline.Team})
CALL apoc.do.when(csvline.Team is NULL,
'merge (team: c\_team {identifier: "csvline.Team"})
set team.name = csvline.Team RETURN team',
{csvline:csvline}
) YIELD value
RETURN value.team as team ;