Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
08-15-2022 06:56 AM - edited 08-15-2022 06:58 AM
Solved! Go to Solution.
08-15-2022 07:20 AM
Why are you trying to use the apoc procedures? For what you want you can just use CALL IN TRANSACTIONS
And for the fallback to "csvline.Team" you can use coalesce(csvLine.Team, "default-value")
Is your file really so large that you need separate transactions?
In apoc.do.when the third parameter is a string for the elseQuery not for the params map
https://neo4j.com/labs/apoc/4.4/overview/apoc.do/apoc.do.when/
08-15-2022 07:20 AM - edited 08-15-2022 07:43 AM
The value of 'csvline' is a map, not a string. 'csvline' is the entire row from the 'load csv', which is a map. Break out the individual keys from the map that you want to send to the query.
Also, you only have one cypher statement. The procedures requires one for when the conditions is 'true' and 'false'. Your map is specified in the third argument, which is supposed to be a string representing the 'else' cypher statement.
Since you don't have an if/else scenario, it may be easier to use a call subquery as follows:
:auto load csv with headers from 'file:///E_Directory_Export.csv' as csvline fieldterminator ';'
call {
with csvline
with csvline
where csvline.team is not null
merge (team: c_team {identifier: csvline.Team})
set team.name = csvline.Team
} in transactions of 1000 rows
08-15-2022 07:20 AM
Why are you trying to use the apoc procedures? For what you want you can just use CALL IN TRANSACTIONS
And for the fallback to "csvline.Team" you can use coalesce(csvLine.Team, "default-value")
Is your file really so large that you need separate transactions?
In apoc.do.when the third parameter is a string for the elseQuery not for the params map
https://neo4j.com/labs/apoc/4.4/overview/apoc.do/apoc.do.when/
08-15-2022 07:20 AM - edited 08-15-2022 07:43 AM
The value of 'csvline' is a map, not a string. 'csvline' is the entire row from the 'load csv', which is a map. Break out the individual keys from the map that you want to send to the query.
Also, you only have one cypher statement. The procedures requires one for when the conditions is 'true' and 'false'. Your map is specified in the third argument, which is supposed to be a string representing the 'else' cypher statement.
Since you don't have an if/else scenario, it may be easier to use a call subquery as follows:
:auto load csv with headers from 'file:///E_Directory_Export.csv' as csvline fieldterminator ';'
call {
with csvline
with csvline
where csvline.team is not null
merge (team: c_team {identifier: csvline.Team})
set team.name = csvline.Team
} in transactions of 1000 rows
All the sessions of the conference are now available online