title: JSON Get parent object from child object
body: <p>How can I get <strong>discount</strong> value if <strong>brand_id=='983'</strong>.</p>
  
  <p>Sample JSON:</p>
  
  <pre><code>{
       "prods": [
                 {
              "info": {
                    "rate": 100
                      },
              "grocery": [
                       {
                        "brand": "A",
                        "brand_id": "983"
                       },
                       {
                        "brand": "B",
                        "brand_id": "253"
                       }
                       ],
               "discount": "20"
           }
       ]
  }
  </code></pre>
  
  <p>What I have tried till now is </p>
  
  <pre><code>$.prods[*].grocery[?(@.brand_id=='983')]
  </code></pre>
  
  <p>This returns me list/array of matched objects. But I am not able to traverse back into the tree. Any help on this?</p>