Closed coreyward closed 2 years ago
This would be a great addition, it would solve a common situation of auto increment order numbers for instance. 👍
Yes, we definitely want to add min
and max
(together with avg
and sum
)!
This took a while, but we have now launched min and max functions, along with a bunch more functions!
It would be exceedingly useful to be able to both filter on and retrieve values using minimum and maximum functions.
Example 1
Fetching a value using a
max
function. This would be useful as aninitialValue
for an auto-incrementing order number field.Example 2
Filtering using a
min
function to retrieve products that have a variant under $20 (e.g. for display in a collection of low-cost add-on items). For clarity, this example assumes theproduct
document has avariants
field that is an array of objects that have apriceInDollars
field on them.