min

ReQL command: min

Command syntax

sequence.min(field | function) → element
sequence.min({index: <indexname>}) → element
r.min(sequence, field | function) → element
r.min(sequence, {index: <indexname>}) → element

Description

Finds the minimum element of a sequence.

The min command can be called with:

  • a field name, to return the element of the sequence with the smallest value in that field;
  • an index (the primary key or a secondary index), to return the element of the sequence with the smallest value in that index;
  • a function, to apply the function to every element within the sequence and return the element which returns the smallest value from the function, ignoring any elements where the function produces a