title: How to check if a certain string is contained within an array returned by JSON_QUERY
body: <p>I'm trying to write a SQL statement that will parse some JSON and return only rows where one of the arrays in the JSON Object contains a given value.</p>
  
  <p>Example JSON:</p>
  
  <pre><code>Object 1:
  {
    "Key1": ["item1", "item2", "item3"]
  }
  
  Object 2:
  {
    "Key1": ["item1", "item3"]
  }
  </code></pre>
  
  <p>I would like to only return rows where <code>JSON_QUERY(object, '$.Key1').Contains("item2")</code> is true (in this example, Object 1).</p>
  
  <p>Of course, this magical function 'Contains()' does not exist in tsql, and I can't find any documentation of a function that performs as I'd like.</p>
  
  <p>EDIT:
  My current solution (which I'm not very fond of and would like to replace) checks if the string literal <code>'"item1"'</code> is contained within the value returned by JSON_QUERY. I don't like this, because it's possible an entry in the array could have a value like <code>'123123"item1"123123'</code>, and then the conditional would return true.</p>