title: JSON path condifitional index of element based on value of another field
body: <p>I want to select array element based on value of another object(not array part)</p>
  <pre><code>{
    &quot;array&quot;: [
      {
        &quot;id&quot;: 1
      },
      {
        &quot;id&quot;: 2
      }
    ],
    &quot;conditionalField&quot;: &quot;ab&quot;
  }
  </code></pre>
  <p>I want select array element based on value of <code>$.conditionalField</code>. I need something like this:</p>
  <p><code>$.array[($.conditionalField == &quot;ab&quot; ? 0 : 1)]</code></p>
  <p>Does json path support this? I use Jayway JSON Path</p>