title: Using jq to select a parent by searching child key/value pair
body: <p>Using <a href="https://stedolan.github.io/jq/" rel="noreferrer" title="jq">jq</a>, how do I select a parent object if it contains a child object that meets two filter requirements?</p>
  
  <p>In this example I want to select all Subnets elements that have a child tag with key "Name" and value "TheName".  My example has two subnets.  The first has "TheName" in the wrong key.  The second subnet has the name/value pair I am looking for.  i.e. <code>"Key": "Name", "Value": "TheName"</code></p>
  
  <p>The following selects a subnet with the specified value in one of the tags but not the pair.  It returns both subnets instead of only the second subnet.</p>
  
  <pre><code>jq '.Subnets[] | select(.Tags[].Value=="TheName")' output
  </code></pre>
  
  <p>How do I use jq to select only the subnets that have the name/value pair I am looking for?</p>
  
  <pre><code>{
      "Subnets": [
          {
              "VpcId": "vpc-12345678",
              "SubnetId": "subnet-1234567a",
              "Tags": [
                  {
                      "Key": "IgnoreThis",
                      "Value": "TheName"
                  },
                  {
                      "Key": "Name",
                      "Value": "NotTheName"
                  }
              ]
          },
          {
              "VpcId": "vpc-12345678",
              "SubnetId": "subnet-1234567b",
              "Tags": [
                  {
                      "Key": "IgnoreThis",
                      "Value": "ignore"
                  },
                  {
                      "Key": "Name",
                      "Value": "TheName"
                  }
              ]
          }
      ]
  }
  </code></pre>
  
  <p>The desired output would be:</p>
  
  <pre><code>{
      "VpcId": "vpc-12345678",
      "SubnetId": "subnet-1234567b",
      "Tags": [
          {
              "Key": "IgnoreThis",
              "Value": "ignore"
          },
          {
              "Key": "Name",
              "Value": "TheName"
          }
      ]
  }
  </code></pre>