I have a field in my db that needs to be updated from a CSV file. The CSV file itself is rather long but in a simple format with a name, a node id, and a level. APOC is not my usual.
The CSV
'prog_name','node','level'
'dirielfran_apuntes.2021-02-27.java',2001,6
'dirielfran_apuntes.2021-02-27.java',3001,6
'dirielfran_apuntes.2021-02-27.java',3002,6
'dirielfran_apuntes.2021-02-27.java',4001,2
'dirielfran_apuntes.2021-02-27.java',5001,4
'dirielfran_apuntes.2021-02-27.java',5002,4
'dirielfran_apuntes.2021-02-27.java',5010,4
'dirielfran_apuntes.2021-02-27.java',6001,6
'dirielfran_apuntes.2021-02-27.java',7001,10
in Cypher this would be match (a {progname:'dirielfran_apuntes.2021-02-27.java', inode:2001}) set a.level = 6 return count(a)
But there are a lot of these so APOC seems to be the way to go on this with an iterate so it gets committed frequently
CALL apoc.periodic.iterate('
CALL apoc.load.csv( 'ProgLevel.csv', {skip:1, limit:1, header:true],
MATCH (p:ProgNode {progname:row.prog_name, inode: row.node ) SET p.level = row.level
', {batchSize:10000, iterateList:true, parallel:true});
What is wrong with my APOC