title: SELECT single field from embedded array in azure documentDB
body: <p>I have a documentDB collection that looks like this sample:</p>
  
  <pre><code>{
      "data1": "hello",
      "data2": [ 
          {
              "key": "key1",
              "value": "value1"
          },
          {
              "key": "key2",
              "value": "value2"
          }
  }
  </code></pre>
  
  <p>In reality the data has a lot of other fields and the embedded array has some fields where the data is quite large.  I need to query the data and I care about the small "key" field in the data2 array but I do not need the large "value".  I am finding returning all the value data is causing performance problems, but if I exclude the array data from the SELECT all together it is fast (so the data size is the issue).</p>
  
  <p>I cannot figure out a way to return only the "key" but exclude the "value" in the embedded array.</p>
  
  <p>I basically want <code>SELECT r.data1, r.data2.key</code> and to have it return as:</p>
  
  <pre><code>{
      "data1": "hello",
      "data2": [ 
          {
              "key": "key1"
          },
          {
              "key": "key2"
          }
  }
  </code></pre>
  
  <p>but it doesn't seem possible to SELECT <code>r.data2.key</code> because it is in an array </p>
  
  <p>A JOIN will cause it to return a copy of each document for each "data2" array element, which does not work for me.  My only other option would be to migrate the data and put the data I want into its own array so I can select the whole object.</p>
  
  <p>Is this possible some how that I have not been able to figure out?</p>