apoc.agg.product

Details

Syntax

apoc.agg.product(value)

Description

Returns the product of all non-null INTEGER and FLOAT values in the collection.

Arguments

Name

Type

Description

value

INTEGER | FLOAT

A value to be multiplied in the aggregate.

Returns

INTEGER | FLOAT

Usage examples

We can compute the product of rows of numeric values, by running the following query:

UNWIND range(1,10) AS value
RETURN apoc.agg.product(value),
       1*2*3*4*5*6*7*8*9*10 AS manualEquivalent;
Results
apoc.agg.product(value) manualEquivalent

3628800

3628800