Just a note, you should not need the first usage of apoc.cypher.run, as you should be able to use match directly.
You pass the external values in a map passed as the “params” parameter in the apoc.periodic.iterate config parameter’s map. Looks like you did this part. You can reference it in the cypher statements passed to the apoc iterate method as $dat_maj.
Finally, it looks like there is missing syntax in your query.
What do you mean from a different cypher request? How are you chaining the result from the match to the apoc call if nit in the same cypher query? Are you using a driver?
It's pleasure to me to explain this.
But, this syntax allows me to create a parameter from cypher request.
This corresponds to **:param val => 1**
In in my actually work, it's a big request, i just simplify it here.
Damn, you read deep into the documentation. My kind of person. I recall reading that a while back, but never used it.
I tried that syntax in the browser and cypher-shell. It worked in browser and not cypher-shell. As such, I don't think it is supported in cypher-shell.
Are you trying to use a parameter, so you can set it and use it multiple times in the same session? Or, can we derive the parameter value in the same query as the apoc.periodic.iterate call?
If you are trying to execute them both in the same query, then look at this example:
match (p:ParentNodeLabel)
where id(p) = 25
with p.name as nameParam
call apoc.periodic.iterate(
'match(n:ParentNodeLabel) return n',
'set n.test = $name',
{params:{name:nameParam}}
) yield total
return total
You can also use a call subquery:
call {
match (p:ParentNodeLabel)
where id(p) = 25
return p.name as nameParam
}
call apoc.periodic.iterate(
'match(n:ParentNodeLabel) return n',
'set n.test = $name',
{params:{name:nameParam}}
) yield total
return total
I wonder what do you eat? I am undoubtedly convinced that if I do not have a solution to a problem posed to you (here) it is because I posed it incorrectly.
Thank you very much
Please can you recommend a training course that I can do because so far my learning is independent.
I used to eat a lot of neo4j documentation. I found it very useful as a learning tool. There are certain topics and tools that I have found very useful to know:
Understanding path patterns
aggregation and how the rows are grouped
list comprehension
map comprehension
call subqueries
using 'with' to derive new variables, aggregate data, and to pass values
list predicates
collect, exists, and count subqueries
unwind and how the data is merged to form the new rows