Showing results for 
Search instead for 
Did you mean: 

Head's Up! Site migration is underway. Phase 2: migrate recent content

Access passed by param POJO object's properties in cypher query

Node Link

Hii! 😀

I have the following ClientNode object in Spring Boot marked with the @Node annotation:


public class ClientNode extends Entity {

private String propA;
private String propB;
private String propC;
private String propD;


I am implementing the following query passing as parameter a ClientNode list:


@Query("" +
"CALL apoc.periodic.iterate('" +
"WITH $insertReq as requests " +
"UNWIND requests as req " +
"RETURN req' " +
"," +
"'" +
"CREATE (n:Client{propA:req.propA, propB:req.propB, propC:req.propC," +
"propD:req.propD})" +
"' " +
"," +
"{ batchSize:1, parallel: true, params: {insertReq: $clientList} }) " +
"YIELD total, failedOperations, errorMessages " +
BatchOperationResponse bulkInsert(List<ClientNode> clientList);

The idea is to insert several clients using the apoc.periodic.iterate function, but the problem is that it does not correctly access the properties of the ClientNode objects passed as parameter.

Does anyone know the correct way to access the ClientNode properties within the iterate function?

Thank you in advance!