apoc.coll.min

Details

Syntax

apoc.coll.min(values)

Description

Returns the minimum of all values in the given LIST<ANY>.

Arguments

Name

Type

Description

values

LIST<ANY>

The list to find the minimum in.

Returns

ANY

This function is not considered safe to run from multiple threads. It is therefore not supported by the parallel runtime. For more information, see the Cypher Manual → Parallel runtime.

Usage examples

The following examples compute the minimum of values in a list using both APOC and Cypher:

apoc.coll.min
RETURN apoc.coll.min([1,2,3,4,5]) AS output;
Cypher’s UNWIND and min()
UNWIND [1,2,3,4,5] AS x
RETURN min(x) AS output;
As a Cypher expression
RETURN head( COLLECT { UNWIND [1,2,3,4,5] AS x RETURN min(x) }) AS output
Results
Output

1