Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
03-09-2022 12:45 AM
I've opened this issue because I think that the Run
function does not perform the parameter substitution but I'm not sure if the code that I wrote is wrong or the problem is in the driver...
Solved! Go to Solution.
03-15-2022 05:07 AM
As Florent rightly said into the GitHub issue thread,
the $idP
present in the second parameter of apoc.trigger.add
is entirely managed by APOC.
Anyway, luckily is possible to pass a configuration to "transfer" your parameter from go-driver
to apoc, see here in "optional params" section.
That is, you could change your query in this way, by adding {params: {idP: $idP}}
:
CALL apoc.trigger.add("create-rel",
"UNWIND $createdNodes as node WITH node
WHERE (node:A)
MATCH (p:P) WHERE id(p) = toInteger($idP)
MERGE (p)-[r:REL]->(node)",
{phase: 'before'}, {params: {idP: $idP}})
I haven't replicated the problem with Go because I don't know it, but via Neo4j Desktop,
however I believe it should work here too.
03-15-2022 05:07 AM
As Florent rightly said into the GitHub issue thread,
the $idP
present in the second parameter of apoc.trigger.add
is entirely managed by APOC.
Anyway, luckily is possible to pass a configuration to "transfer" your parameter from go-driver
to apoc, see here in "optional params" section.
That is, you could change your query in this way, by adding {params: {idP: $idP}}
:
CALL apoc.trigger.add("create-rel",
"UNWIND $createdNodes as node WITH node
WHERE (node:A)
MATCH (p:P) WHERE id(p) = toInteger($idP)
MERGE (p)-[r:REL]->(node)",
{phase: 'before'}, {params: {idP: $idP}})
I haven't replicated the problem with Go because I don't know it, but via Neo4j Desktop,
however I believe it should work here too.
03-16-2022 07:40 AM
Thank you for your response and solution; it worked well.
Sorry I've missed the additional params
parameter.
All the sessions of the conference are now available online