title: Sorting and filtering a json file using jq
body: <p>I'm trying to parse a json file in order to create a deletion list for an artifactory instance.</p>
  
  <p>I'd like group them by two fields: repo and path. And then keep the two objects for each grouping with the most recent "modified" timestamp and delete all the other objects in the json file. </p>
  
  <p>So, an original file that looks like this:</p>
  
  <pre><code>{
    "results": [
      {
        "repo": "repo1",
        "path": "docker_image_dynamic",
        "size": 3624,
        "modified": "2016-10-01T06:22:16.335Z"
      },
      {
        "repo": "repo1",
        "path": "docker_image_dynamic",
        "size": 3646,
        "modified": "2016-10-01T07:03:58.465Z"
      },
      {
        "repo": "repo1",
        "path": "docker_image_dynamic",
        "size": 3646,
        "modified": "2016-10-01T07:06:36.522Z"
      },
      {
        "repo": "repo2",
        "path": "docker_image_static",
        "size": 3624,
        "modified": "2016-09-29T20:31:44.054Z"
      }
    ]
  }
  </code></pre>
  
  <p>should become this:</p>
  
  <pre><code>{
    "results": [
      {
        "repo": "repo1",
        "path": "docker_image_dynamic",
        "size": 3646,
        "modified": "2016-10-01T07:03:58.465Z"
      },
      {
        "repo": "repo1",
        "path": "docker_image_dynamic",
        "size": 3646,
        "modified": "2016-10-01T07:06:36.522Z"
      },
      {
        "repo": "repo2",
        "path": "docker_image_static",
        "size": 3624,
        "modified": "2016-09-29T20:31:44.054Z"
      }
    ]
  }
  </code></pre>