Reference

db.min

The full row holding the smallest value of a column.
Query.min(accessor) → Query<T | null>

Returns the whole row holding the smallest value of the accessed column, or null over an empty set. You get the full record, not just the value, so one call gives you both the minimum and the row it came from. Filter first to bound the search.

Parameters
accessor
(row) => number
RequiredThe column to minimize.
Row with the minimum
const cheapest = await Products.min((p) => p.priceCents);