Liking cljdoc? Tell your friends :D

min-by

The min-by aggregate function allows you to find the row with some lowest value across a set of rows.

In this example, we get the row having the minimum :id across the entire :Customer table.

;; QUERY
[[:from :Customer] 
 [:agg [] [:min-id-row [rel/min-by :id]]]]

;; STATE 
{:Customer #{{:id 0}, {:id 1}, {:id 2}}}

;; RESULT
({:min-id-row {:id 0}})

Can you improve this documentation?Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close