I am trying to run the below query to get more information from the query but getting the below error -
Neo.ClientError.Statement.SyntaxError: Variable timeTaken not defined (line 2, column 46 (offset: 209))
"yield batches, total return batches, total , timeTaken , failedOperations , failedBatches , errorMessages , committedOperations , operations;"
^
CYPHER QUERY -
call apoc.periodic.iterate(" MATCH (c:CARD) , (p:PORT) where c.CARD_CI_NAME = p.PARENT_CI_NAME return c,p", "MERGE (c)-[r:card2port]->(p)" , {batchSize:1000})
yield batches, total return batches, total , timeTaken , failedOperations , failedBatches , errorMessages , committedOperations , operations;
May I know how to use the above variables in my query ? or if possible give me suitable example to use these variables correctly and efficiently in query.
If you want all yielded variables, and the iterate() call is the only clause present, then just do the call and all the variables will be yielded and returned:
CALL apoc.periodic.iterate(" MATCH (c:CARD) , (p:PORT) where c.CARD_CI_NAME = p.PARENT_CI_NAME return c,p", "MERGE (c)-[r:card2port]->(p)" , {batchSize:1000});
Otherwise, YIELD all the variables you want to work with from the call, then use/return them:
Procedures can only YIELD variables defined in the procedure's signature. You can always alias variables with the as keyword (for example, YIELD batches as importantVariable), and of course any variable you use in a MATCH pattern is added to scope as well.
You may want to go through the Cypher documentation first to get a better understanding of what you can do.