title: Azure CosmosDB REST API omits results that data explorer returns
body: <p>I have a reasonably large cosmos db collection (circa 1.5million records).  If I run a query on an indexed field in the <strong>data explorer</strong> such as:</p>
  
  <pre><code>SELECT * FROM c WHERE ARRAY_CONTAINS(c.InnerArray, { "MyValue": 1234 }, true)
  </code></pre>
  
  <p>I receive the result as I expect. </p>
  
  <p>If I perform the same query over the REST API I receive:</p>
  
  <pre class="lang-js prettyprint-override"><code>{
      "_rid": "...",
      "Documents": [],
      "_count": 0
  }
  </code></pre>
  
  <p>This difference varies.  For some documents I receive it within the portal data explorer AND the REST API for others only the Data Explorer.</p>
  
  <p>I've narrowed down one difference but I'm not sure what the 'fix' is (assuming this is the problem). </p>
  
  <p>If I export the <em>'Per-partition query metrics (CSV)'</em> from the portal I can see that documents that return over the REST api are found within 'partition key range id' 0.  Those that do not appear over the REST api (but do appear in the portal) are in 'partition key range id' 1.</p>
  
  <p>Is there some additional configuration or header that I need to set over the REST api? I set request headers including <code>x-ms-documentdb-query-enablecrosspartition</code> and receive null continuation tokens in the response.</p>
  
  <p><strong>Additional Note</strong>: 
  The C# SDK (in both Gateway and Direct) connection mode will return the documents that the REST API does not.</p>