max

Full name: taxi.stdlib.max

Signature

declare extension function <T,A> max(collection: T[], callback: (T) -> A):A

Description

Returns the maximum value in the collection, computed by applying the selector function to each element.

find { products: Product[] } as {
   mostExpensive: Price = products.max((Product) -> Price)
}

Examples

Returns the maximum price from a collection of products.

Try it out

Schema
Query Plan
Play with this snippet by editing it here, or edit it on Taxi Playground
Result
Query failed
Next
Welcome to Taxi