Hello,
executing below query I'm receiving an error:
Query:
@Query( "call apoc.periodic.iterate("
+ "\"UNWIND $items as item return item\" , "
+ "\"MERGE (s1:s{id:item.customId}) "
+ "WITH s1 "
+ "MERGE (e1:e{id:item.customId}) "
+ "MERGE (s1)-[r:item.type]->(e1) "
+ "SET r.id=item.customId, r.name=item.name\", "
+ "{batchSize:5, parallel:true, iterateList:true,params:{items:$itemss}})")
Result saveAll2(@Param("itemss") List<OrchestraRelationship> items);
Error:
Invalid input '.': expected an identifier character, whitespace, '|', a length specification, a property map or ']' (line 1, column 140 (offset: 139))
"UNWIND $_batch AS _batch WITH _batch.item AS item MERGE (s1:s{id:item.customId}) WITH s1 MERGE (e1:e{id:item.customId}) MERGE (s1)-[r:item.type]->(e1) SET r.id=item.customId, r.name=item.name"
^
The relation type should come from a parameter because I'm building lots of relations, i.e. dynamic relation type.
Said that I tried to put a static relation name but received also an error:
Query:
@Query( "call apoc.periodic.iterate("
+ "\"UNWIND $items as item return item\" , "
+ "\"MERGE (s1:s{id:item.customId}) "
+ "WITH s1 "
+ "MERGE (e1:e{id:item.customId}) "
+ "MERGE (s1)-[r:BORA]->(e1) "
+ "SET r.id=item.customId, r.name=item.name\", "
+ "{batchSize:5, parallel:true, iterateList:true,params:{items:$itemss}})")
Result saveAll2(@Param("itemss") List<OrchestraRelationship> items);
Error:
Variable `item` not defined (line 1, column 106 (offset: 105))
"UNWIND $_batch AS _batch WITH _batch.item AS item MERGE (s1:s{id:item.customId}) WITH s1 MERGE (e1:e{id:item.customId}) MERGE (s1)-[r:BORA]->(e1) SET r.id=item.customId, r.name=item.name"
^ -> {Long@9015} 1
Hope someone can advise regards.
Thanks,
Boris