In some cases min always returns first position. This is especially problematic with instances where you want the min between two nodes such as the last example.
Doesn't work
return min(6,4)
6
Works
return min(6.0,4.0)
4.0
Doesn't work
UNWIND [6,4] as val
RETURN min(val)
4
Doesn't work
Match (c1:Collision)-->(c2:Collision) where id(c1) < id(c2) return id(c1),id(c2), min(id(c2),id(c1)) as min limit 10
In some cases min always returns first position. This is especially problematic with instances where you want the min between two nodes such as the last example.
Doesn't work
return min(6,4) 6
Works
return min(6.0,4.0) 4.0
Doesn't work
UNWIND [6,4] as val RETURN min(val) 4
Doesn't work
Match (c1:Collision)-->(c2:Collision) where id(c1) < id(c2) return id(c1),id(c2), min(id(c2),id(c1)) as min limit 10