]> granicus.if.org Git - jq/commitdiff
Added texts/examples to unique_by function 360/head
authorSantiago Lapresta <santiago.lapresta@gmail.com>
Sun, 11 May 2014 23:43:00 +0000 (01:43 +0200)
committerSantiago Lapresta <santiago.lapresta@gmail.com>
Sun, 11 May 2014 23:44:53 +0000 (01:44 +0200)
docs/content/3.manual/manual.yml

index 2e2fb36602709d9af40d58220e72377676619f88..aec2ca1977021e061433505d6ce86976d59c127c 100644 (file)
@@ -941,9 +941,12 @@ sections:
           `group_by`.
         
         examples:
-          - program: 'unique'
-            input: '[1,2,5,3,5,3,1,3]'
-            output: ['[1,2,3,5]']
+          - program: 'unique_by(.foo)'
+            input: '[{"foo": 1, "bar": 2}, {"foo": 1, "bar": 3}, {"foo": 4, "bar": 5}]'
+            output: ['[{"foo": 1, "bar": 2}, {"foo": 4, "bar": 5}]']
+          - program: 'unique_by(length)'
+            input: '["chunky", "bacon", "kitten", "cicada", "asparagus"]'
+            output: ['["chunky", "bacon", "asparagus"]']
 
 
       - title: `reverse`