title: Have jq return the index number of an element in an array
body: <p>I want jq to return the index of an alement in an array based on a search.</p>
  
  <p>Using the below array I call jq to find the value <code>"FooBar"</code> of a key <code>"text"</code>:</p>
  
  <pre><code>jq '.arr[] | .[3].text | tostring | select(contains("FooBar") )' &lt; file.json
  </code></pre>
  
  <p>The result is:</p>
  
  <pre><code>"FooBar"
  </code></pre>
  
  <p>But what I actually want is the index of the most outer array <code>"arr"</code> that this <code>text:FooBar</code> pair is nested in, which is 0 in this case.</p>
  
  <p>Can this e achieved in jq?</p>
  
  <pre><code>{
  "arr": [
      [
        "create",
        "w71",
        "rwt.widgets.Label",
        {
          "parent": "w68",
          "style": "1",
          "bounds": "2",
          "tabIndex": -1,
          "background": "ww",
          "font": "test",
          "text": "FooBar",
          "alignment": "right"
        }
      ],
      [
            "create",
            "w72",
            "rwt.widgets.Label",
            {
              "parent": "w68",
              "style": "22",
              "bounds": "1",
              "tabIndex": -1,
              "foreground": "null",
              "background": "1",
              "font": "2",
              "text": "55",
              "alignment": "right"
            }
          ]
    ]
  }
  </code></pre>