title: Filtering objects in jq by existence of nested array values
body: <p>Given a document like this:</p>
  
  <pre><code>[
    {
      "KVs" : [
        {
          "Key": "animal",
          "Value": "lion"
        },
        {
          "Key": "mascot",
          "Value": "lion"
        }
      ],
      "name": "roger"
    },
    {
      "KVs" : [
        {
          "Key": "animal",
          "Value": "zebra"
        },
        {
          "Key": "mascot",
          "Value": "lion"
        }
      ],
      "name": "linda"
    }
  ]
  </code></pre>
  
  <p>I want to use <code>jq</code> to select only those elements of the top array that contain the KV pair <code>animal == "lion"</code>.</p>
  
  <p>The output for the above JSON document should be:</p>
  
  <pre><code>{
    "KVs" : [
      {
        "Key": "animal",
        "Value": "lion"
      },
      {
        "Key": "mascot",
        "Value": "lion"
      }
    ],
    "name": "roger"
  }
  </code></pre>
  
  <p>Can't figure out how to accomplish this with <code>select()</code>. I know how to use it to select based on one specific field. e.g. by key name: <code>.[] | select(.KVs[].Key == "animal")</code>, right? But how do I tell it to match the same KV object on two fields (Key &amp; Value)?</p>