title: Cosmos db sql query for search in array
body: <p>I have a document structure like below </p>
  
  <pre><code>[
      {
          "id": "1",
          "author": "John Smith",
          "partNames": [
              "PART.5",
              "PART.10",
              "PART.15",
              "PART.30",
              "PART.31"
          ]
          ...
      },
      {
          "id": "2",
          "author": "Mike Smith",
          "partNames": [
              "PART.4",
              "PART.6",
              "PART.17",
              "PART.18",
              "PART.20"
          ]
          ...
      }
  ]
  </code></pre>
  
  <p>and I try to implement searching for user by fields author and partNames, so user can do query like </p>
  
  <p><code>SELECT * FROM c WHERE CONTAINS(c.author, 'John')</code> </p>
  
  <p>and user will get in result the <code>id=1</code> document because the name of author was <code>John</code>.</p>
  
  <p>The next step is to allow user ask for document by parts, so for example I want to receive a document where <code>PART.4</code> exists, so the query will be </p>
  
  <p><code>SELECT * FROM c WHERE ARRAY_CONTAINS(c.partNames, 'PART.4', true)</code></p>
  
  <p>and it returns document <code>id=2</code>.</p>
  
  <p>Going further I'd like to make query that allows user to type just <code>PART.1</code> and he will receive documents <code>id=1</code> and <code>id=2</code> because both have parts starting with <code>PART.1</code> </p>
  
  <p>So is there a way to achieve it? </p>