Updating a field with APOC CSV

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.



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

Still looking for some help on this one. Thanks

What error are you getting?

I think you need something like this either way:

CALL apoc.periodic.iterate(
  'CALL apoc.load.csv( 'ProgLevel.csv', {skip:1, limit:1, header:true}) 
   YIELD map as row',
  'MATCH (p:ProgNode {progname:row.prog_name, inode: row.node} ) 
   SET p.level = row.level',
 {batchSize:10000, iterateList:true, parallel:true}

That worked perfectly thank you.

The issue turned out to be a combination of factors. There seems to be an inconsistency in the APOC.CONF and normal CONF that was biting us at first

One of these lines is from the documentation, one from the error message.


and the other was just tricky syntax although from your response, your indentation was helpful.
Thank you