title: JSON Path to get value of next element in an array based on previous element?
body: <p>Is there any way to write JSON Path to get value of next element in an array based on previous element ?</p>
  
  <p>JSON :</p>
  
  <pre><code>[
     [
        "value11",
        "text1",
        "value12"
     ],
     [
        "value21",
        "text2",
        "value22"
     ],
     [
        "value31",
        "text3",
        "value32"
     ],
     [
        "value41",
        "text4",
        "value42"
     ]
  ]
  </code></pre>
  
  <p>Expected :</p>
  
  <p>Path : $[0][if matches "searchtext"] next|previous</p>
  
  <blockquote>
    <p>Searchtext : text1 output (get next value) : value12 output (get
    previous value) : value11</p>
    
    <p>Searchtext : text2 output (get next value) : value22 output (get
    previous value) : value21</p>
  </blockquote>
  
  <p>I'm using  <a href="https://github.com/jayway/JsonPath" rel="nofollow noreferrer">https://github.com/jayway/JsonPath</a> for implementation.</p>
  
  <p>Thanks in advance.</p>
  
  <p>-- Mani</p>