title: how to i select multiple keys using JQ
body: <p>How can <code>jq</code> extract both the <code>index</code> key and <code>doctype</code> key based on the <code>dynamic</code> attribute?:</p>
  
  <pre><code>{
      "index1": {
          "mappings": {
              "doctype1": {
                  "dynamic": "true"
              },
              "doctype2": {
                  "dynamic": "static"
              }
          }
      },
      "index2": {
          "mappings": {
              "doctype3": {
                  "dynamic": "static"
              },
              "doctype4": {
                  "dynamic": "true"
              }
          }
      }
  }
  </code></pre>
  
  <p>to give:</p>
  
  <pre><code>{
      "index1": {
          "doctype2": { "dynamic": "static" }
      },
      {
      "index2": {
          "doctype3": { "dynamic": "static" }
      }
  }
  </code></pre>
  
  <p>or</p>
  
  <pre><code>{
      "index1": "['doctype2']",
      "index2": "['doctype3']"
  }
  </code></pre>
  
  <p>I have tried:</p>
  
  <pre><code>jq '. | keys as $i | .[].mappings | keys as $d | $i $d'
  </code></pre>
  
  <p>but it's not even close</p>