title: Get path expression of a value inside JSON data using case insensitive search using MySQL Json_search function
body: <p>I have a requirement where by I need to extract JSON path expression from a JSON data searching by a value. </p>
  
  <p>For example if I have the JSON data stored like  </p>
  
  <pre><code>SET @j = '[{"name":"Kiran Muralee", "age" : 30 , "Salary" : 30000},
        {"Name":"Arun Babu", "age" : 35 , "Salary" : 60000}]';
  </code></pre>
  
  <p>And if I need to get the JSON Path of value <strong>'Arun Babu'</strong> I could use</p>
  
  <pre><code>SELECT JSON_SEARCH(@j, 'all', 'Arun Babu');
  </code></pre>
  
  <p>This results in  </p>
  
  <pre><code>"$[1].Name"
  </code></pre>
  
  <p>Which is right but the problem is if I search with value <strong>'arun babu'</strong>, it returns NULL. So to do a case insensitive search I used  </p>
  
  <pre><code>SELECT JSON_SEARCH(lower(@j), 'all', lower('arun babu'));
  </code></pre>
  
  <p>So now I am getting the result as </p>
  
  <pre><code>"$[1].name"
  </code></pre>
  
  <p>But this is not I needed because now the result also outputted in lower case, I need the result to be<br>
       "$[1].Name" 
  Can anyone suggest a good solution or approach.</p>
  
  <p>MySQL version using is 5.7 (JSON type supported version)</p>