Lucee Function Reference

queryreduce()

Iterates over every row of the given query and calls the closure with that row.
      This function will reduce the query to a single value and will return this value.

Example

queryreduce(query query,function closure,[object initialValue]):any

Category

query,iterator

Arguments

The arguments for this function are set. You can not use other arguments except the following ones.
Name Type Required Description
query query  Yes query to iterate  
closure function  Yes function/closure that implements the following constructor [function(any result, struct row[, number rowNumber, query query]):any].  
initialValue object  No inital value passed as part of the first closure call