title: Complex JMESPath filter on a large JSON file
body: <p>Please consider the following JSON extract (the data is much larger but this is a shorter piece of it i'm trying to get to work)</p>
  
  <pre><code>jsonData = """{
    "products" : {
      "DQ578CGN99KG6ECF" : {
        "sku" : "DQ578CGN99KG6ECF",
        "productFamily" : "Compute",
        "attributes" : {
          "location" : "US East (N. Virginia)",
          "instanceType" : "hs1.8xlarge",
          "tenancy" : "Shared",
          "operatingSystem" : "Windows",
          "licenseModel" : "License Included",
          "preInstalledSw" : "NA"
        }
      },
      "G2N9F3PVUVK8ZTGP" : {
        "sku" : "G2N9F3PVUVK8ZTGP",
        "productFamily" : "Instance",
        "attributes" : {
          "location" : "Asia Pacific (Seoul)",
          "instanceType" : "i2.xlarge",
          "tenancy" : "Host",
          "operatingSystem" : "Windows",
          "licenseModel" : "License Included",
          "preInstalledSw" : "SQL Server Enterprise"
        }
      },
      "FBZZ2TKXWWY5HZRX" : {
        "sku" : "FBZZ2TKXWWY5HZRX",
        "productFamily" : "Compute",
        "attributes" : {
          "location" : "Asia Pacific (Seoul)",
          "instanceType" : "i2.4xlarge",
          "tenancy" : "Dedicated",
          "operatingSystem" : "SUSE",
          "licenseModel" : "No License required",
          "preInstalledSw" : "NA"
        }
      }
    }
  }"""
  </code></pre>
  
  <p>I'm not able to create a proper filter to find say all products with "Windows" as operatingSystem and tenancy shared.</p>
  
  <p>I got to this point:</p>
  
  <pre><code>priceJson = json.loads(jsonData)
  query = "products.*.attributes[?operatingSystem=='Windows' &amp;&amp; tenancy=='Shared']"
  output_dict = jmespath.search(query, priceJson)
  </code></pre>
  
  <p>however i loose the sku # this way.</p>
  
  <p>Result:</p>
  
  <pre><code>[{        
          "location" : "US East (N. Virginia)",
          "instanceType" : "hs1.8xlarge",
          "tenancy" : "Shared",
          "operatingSystem" : "Windows",
          "licenseModel" : "License Included",
          "preInstalledSw" : "NA"
  }]
  </code></pre>
  
  <p>What i'd like to get:</p>
  
  <pre><code>[
    { "sku": "DQ578CGN99KG6ECF",
      "attributes" : {
          "location" : "US East (N. Virginia)",
          "instanceType" : "hs1.8xlarge",
          "tenancy" : "Shared",
          "operatingSystem" : "Windows",
          "licenseModel" : "License Included",
          "preInstalledSw" : "NA"
      }
  }]
  </code></pre>
  
  <p>Any idea how to get to that result ?</p>