title: How to check the input string present in json array using json path
body: <p>I am trying to check the given input string is present in a json array. Below is my sample json</p>
  <pre><code>{
      &quot;school&quot;: {
          &quot;class&quot;: {
              &quot;standard&quot;: &quot;6&quot;,
              &quot;student_list&quot;: [
                  &quot;Daniel&quot;,
                  &quot;Jack&quot;,
                  &quot;John&quot;
              ]
          }
      }
  }
  </code></pre>
  <p>Let say i am trying to find a given input name is part of student_list if the given input name matches then it should retrieve the complete details of the class. Let say i am passing name 'John' it should  give me below result</p>
  <pre><code>{
              &quot;standard&quot;: &quot;6&quot;,
              &quot;student_list&quot;: [
                  &quot;daniel&quot;,
                  &quot;jack&quot;,
                  &quot;john&quot;
              ]
          }
  </code></pre>
  <p>I am using jayway json path library i tried couple of ways like below</p>
  <pre><code>$.school.class.[?('john' anyof @.student_list)]
  $.school.class.[?(@.'john' anyof @.student_list)]
  </code></pre>
  <p>But every time it is giving me empty array. I am new to jsonpath query could you please point me where i am going wrong or help me what is wrong with my json path query.</p>