- I want to pass the list that needs to be iterated and create nodes and relationships out of it.
- I am using Apoc.periodic.iterate now because previously i have tried with unwind which caused deadlock due to parallel execution.
- Help me to fix the current code section.
- 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);