Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
06-22-2021 08:50 AM
Hello,
I want to migrate to the new declareFunction
as asFunction
is deprecated, but I have a hard time defining a custom function with multiple parameters.
The documentation and testcases only contains a single parameter with the name input
.
Every other parameter name seem to fail and extra parameters seem to be ignored.
I tried this query:
CALL apoc.custom.declareFunction('foobar(input::NODE, y::NODE) ::(NODE)',
'MATCH (n) RETURN n limit 1');
The declaration looks successful but when looking at the defined function (call apoc.custom.list
) it looks like this:
"function" "foobar" "" null "MATCH (n) RETURN n limit 1" [["input", "node"]] "node" false
Any ideas how to solve this?
Cheers,
Ron
Solved! Go to Solution.
06-24-2021 12:31 AM
Hi @rweverwijk
There seems to be a bug with single character parameters ( y
in your case)
In fact, with CALL apoc.custom.declareFunction('foobaz((input::NODE, input2::NODE)) ::(NODE)', 'MATCH (n) RETURN n limit 1');');
the input field is [["input", "node"], ["input2", "node"]]
.
I created an issue for this one: The procedure apoc.custom.declareFunction does not work correctly with single character parameters ·...
06-24-2021 12:31 AM
Hi @rweverwijk
There seems to be a bug with single character parameters ( y
in your case)
In fact, with CALL apoc.custom.declareFunction('foobaz((input::NODE, input2::NODE)) ::(NODE)', 'MATCH (n) RETURN n limit 1');');
the input field is [["input", "node"], ["input2", "node"]]
.
I created an issue for this one: The procedure apoc.custom.declareFunction does not work correctly with single character parameters ·...
06-30-2021 05:45 AM
Perfect, thanks a lot, I was blindsided by the single character issue!
All the sessions of the conference are now available online