title: jq sort by value of key
body: <p>Given the following JSON (oversimplified for the sake of the example), I need to order the keys by their value. In this case, the order should be id &gt; name &gt; type.</p>
  <pre><code>{
      &quot;link&quot;: [{
              &quot;attributes&quot;: [{
                      &quot;value&quot;: &quot;ConfigurationElement&quot;,
                      &quot;name&quot;: &quot;type&quot;
                  }, {
                      &quot;value&quot;: &quot;NAME1&quot;,
                      &quot;name&quot;: &quot;name&quot;
                  }, {
                      &quot;value&quot;: &quot;0026a8b4-ced6-410e-9213-e3fcb28b3aab&quot;,
                      &quot;name&quot;: &quot;id&quot;
                  }
              ],
              &quot;href&quot;: &quot;href1&quot;,
              &quot;rel&quot;: &quot;down&quot;
          }, {
              &quot;attributes&quot;: [{
                      &quot;value&quot;: &quot;0026a8b4-ced6-410e-9213-k23g15h2u1l5&quot;,
                      &quot;name&quot;: &quot;id&quot;
                  }, {
                      &quot;value&quot;: &quot;ConfigurationElement&quot;,
                      &quot;name&quot;: &quot;type&quot;
                  }, {
                      &quot;value&quot;: &quot;NAME2&quot;,
                      &quot;name&quot;: &quot;name&quot;
                  }
              ],
              &quot;href&quot;: &quot;href2&quot;,
              &quot;rel&quot;: &quot;down&quot;
          }
      ],
      &quot;total&quot;: 2
  }
  </code></pre>
  <p>EXPECTED RESULT:</p>
  <pre><code>{
      &quot;link&quot;: [{
              &quot;attributes&quot;: [{
                      &quot;value&quot;: &quot;0026a8b4-ced6-410e-9213-e3fcb28b3aab&quot;,
                      &quot;name&quot;: &quot;id&quot;
                  }, {
                      &quot;value&quot;: &quot;NAME1&quot;,
                      &quot;name&quot;: &quot;name&quot;
                  }, {
                      &quot;value&quot;: &quot;ConfigurationElement&quot;,
                      &quot;name&quot;: &quot;type&quot;
                  }
              ],
              &quot;href&quot;: &quot;href1&quot;,
              &quot;rel&quot;: &quot;down&quot;
          }, {
              &quot;attributes&quot;: [{
                      &quot;value&quot;: &quot;0026a8b4-ced6-410e-9213-k23g15h2u1l5&quot;,
                      &quot;name&quot;: &quot;id&quot;
                  }, {
                      &quot;value&quot;: &quot;NAME2&quot;,
                      &quot;name&quot;: &quot;name&quot;
                  }, {
                      &quot;value&quot;: &quot;ConfigurationElement&quot;,
                      &quot;name&quot;: &quot;type&quot;
                  }
              ],
              &quot;href&quot;: &quot;href2&quot;,
              &quot;rel&quot;: &quot;down&quot;
          }
      ],
      &quot;total&quot;: 2
  }
  </code></pre>
  <p>I would be very grateful if anyone could help me out. I tried jq with -S and -s with sort_by(), but this example is way too complex for me to figure it out with my current experience with jq. Thank you a lot!</p>