title: Sort an array of objects within an array by most recent timestamp, and then sort the outer array by each array's first object's timestamp, using jq
body: <p>Sort an array of objects within an array by most recent timestamp, and then sort the outer array by each array's first object's timestamp, using <code>jq</code>.</p>
  <p>This is an example of the JSON data, at the stage of the <code>jq</code> pipeline where I'm stuck.</p>
  <pre><code>[
    [
      {
        &quot;created_at&quot;: &quot;2020-09-26T14:48:46.000Z&quot;,
        &quot;conversation_id&quot;: &quot;1309867515456237571&quot;,
        &quot;id&quot;: &quot;1309867515456237571&quot;,
        &quot;text&quot;: &quot;example1&quot;
      }
    ],
    [
      {
        &quot;created_at&quot;: &quot;2020-09-26T14:48:47.000Z&quot;,
        &quot;conversation_id&quot;: &quot;1309867518455156736&quot;,
        &quot;id&quot;: &quot;1309867518455156736&quot;,
        &quot;text&quot;: &quot;example2&quot;
      },
      {
        &quot;created_at&quot;: &quot;2020-09-26T14:48:47.000Z&quot;,
        &quot;conversation_id&quot;: &quot;1309867518455156736&quot;,
        &quot;id&quot;: &quot;1309867517846810625&quot;,
        &quot;text&quot;: &quot;example3&quot;
      },
      {
        &quot;created_at&quot;: &quot;2020-09-26T14:48:46.000Z&quot;,
        &quot;conversation_id&quot;: &quot;1309867518455156736&quot;,
        &quot;id&quot;: &quot;1309867516659937284&quot;,
        &quot;text&quot;: &quot;example4&quot;
      }
    ],
    [
      {
        &quot;created_at&quot;: &quot;2020-09-26T14:48:48.000Z&quot;,
        &quot;conversation_id&quot;: &quot;1309867524473999364&quot;,
        &quot;id&quot;: &quot;1309867524473999364&quot;,
        &quot;text&quot;: &quot;example5&quot;
      },
      {
        &quot;created_at&quot;: &quot;2020-09-26T14:48:47.000Z&quot;,
        &quot;conversation_id&quot;: &quot;1309867524473999364&quot;,
        &quot;id&quot;: &quot;1309867520468291586&quot;,
        &quot;text&quot;: &quot;example6&quot;
      },
      {
        &quot;created_at&quot;: &quot;2020-09-26T14:48:47.000Z&quot;,
        &quot;conversation_id&quot;: &quot;1309867524473999364&quot;,
        &quot;id&quot;: &quot;1309867520153845760&quot;,
        &quot;text&quot;: &quot;example7&quot;
      }
    ],
    [
      {
        &quot;created_at&quot;: &quot;2020-09-26T14:48:48.000Z&quot;,
        &quot;conversation_id&quot;: &quot;1309867524750749705&quot;,
        &quot;id&quot;: &quot;1309867524750749705&quot;,
        &quot;text&quot;: &quot;example8&quot;
      }
    ]
  ]
  </code></pre>
  <p>Everything I've tried ends up with an error like this one,</p>
  <pre><code>jq: error (at &lt;stdin&gt;:8): Cannot index string with string &quot;created_at&quot;
  </code></pre>