Neo4j Browser version: 4.0.5
As part of an analysis process I get 5 (dirty) collections mixed with numbers, text ans NULLs. I'd like to find the maximum number over all 5 collections. Therefore I did something like
<RETURN apoc.coll.max(++[1,2,3,4,5,6]+[7,0]+["ABC"]+) > ==> 7 (fine)
Unfortunately some of the collections have NULL values
<return apoc.coll.max([NULL]+[NULL]+[NULL]+[0,1,2]) > ==> 2 (fine)
<return apoc.coll.max([0,1,2]+[NULL])> ==> 2 (fine)
<return apoc.coll.max([NULL]+[NULL]+[NULL]+[0,1,2]+[NULL]) > ==> NULL
afterwords executing again
<return apoc.coll.max([0,1,2]) > ==> NULL
The only chance to get rid of this NULL is to restart the database
Additional to this:
<apoc.coll.max([""]++[1,2,3,4,5,6]+[7,0]+["ABC"]+)> ==> "ABC"
I would like to have the control, that the apoc.coll.max evaluates only numeric values and not occasionally text.
There's a bug in versions before 4.0.4 with respect to how
apoc.coll.max work. If you bump your Neo4j version that should sort it out.
See the note on the APOC releases page about this issue - https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/tag/18.104.22.168