summaryrefslogtreecommitdiffstats
path: root/docs/content
diff options
context:
space:
mode:
authorStephen Dolan <mu@netsoc.tcd.ie>2012-12-04 22:45:03 +0000
committerStephen Dolan <mu@netsoc.tcd.ie>2012-12-04 22:45:03 +0000
commitc0a2f1ab470595d85fd20a643325a16737433a2a (patch)
treefdc5da6cb28fef74cba8e6bf76bef4bd2c019fec /docs/content
parent616e8f9924ad9df22acf58c79c5d49ef6030fcb8 (diff)
Add min, max, min_by, max_by functions.
Diffstat (limited to 'docs/content')
-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: |