cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

APOC.PERIODIC.ITERATE Dynamic list iteration java/Spring

  1. I want to pass the list that needs to be iterated and create nodes and relationships out of it.
  2. I am using Apoc.periodic.iterate now because previously i have tried with unwind which caused deadlock due to parallel execution.
  3. Help me to fix the current code section.
  4. I am processing more than 900k data in chunks. Which i will read it from kafka topics.

@Query("CALL apoc.periodic.iterate("+"""
+ " UNWIND $items as item return item" ,"
+ ""MERGE (src:Item {name: item.name}) "
+ " ON CREATE SET src.name = item.name, "
+ " src.updateDate = {processDate} "
+ "MERGE (dest:ItemDet {upc: item.upc}) "
+ " ON CREATE SET dest.upc = item.upc, "
+ " dest.creationDate = {processDate} " )",
{batchSize:1000, parallel:false,iterateList:true,params:{items:{items}}})")
Result mergeItems(@Param("items") List<?> items,
@Param("processDate") String processDate);

1 REPLY 1

You missed to pass in processDate as a parameter to the periodic.iterate.