summaryrefslogtreecommitdiffstats
path: root/docs/content/3.manual/manual.yml
diff options
context:
space:
mode:
Diffstat (limited to 'docs/content/3.manual/manual.yml')
-rw-r--r--docs/content/3.manual/manual.yml16
1 files changed, 16 insertions, 0 deletions
diff --git a/docs/content/3.manual/manual.yml b/docs/content/3.manual/manual.yml
index 2e616e14..15dcb489 100644
--- a/docs/content/3.manual/manual.yml
+++ b/docs/content/3.manual/manual.yml
@@ -542,6 +542,22 @@ sections:
input: '[{"foo":1, "bar":10}, {"foo":3, "bar":100}, {"foo":1, "bar":1}]'
output: ['[[{"foo":1, "bar":10}, {"foo":1, "bar":1}], [{"foo":3, "bar":100}]]']
+ - title: `min`, `max`, `min_by`, `max_by`
+ body: |
+
+ Find the minimum or maximum element of the input array. The
+ `_by` versions allow you to specify a particular field or
+ property to examine, e.g. `min_by(.foo)` finds the object
+ with the smallest `foo` field.
+
+ examples:
+ - program: 'min'
+ input: '[5,4,2,7]'
+ output: ['2']
+ - program: 'max_by(.foo)'
+ input: '[{"foo":1, "bar":14}, {"foo":2, "bar":3}]'
+ output: ['{"foo":2, "bar":3}']
+
- title: `unique`
body: |