title: Fetching documents from DocumentDb using continuation token
body: <p>I have a DocumentDb database with a collection containing 37 documents with each around 150Kb each, now I use the following code snippet to fetch the documents using paging</p>
  
  <pre><code>    var options = new FeedOptions
      {
          MaxItemCount = 100
      };
  
      var query = client.CreateDocumentQuery&lt;Document&gt;(collection, options).AsDocumentQuery();
  
      while (query.HasMoreResults)
      {
          var result = query.ExecuteNextAsync&lt;Document&gt;().Result;
          Console.WriteLine("Quota Usage: {0}", result.CurrentResourceQuotaUsage);
          Console.WriteLine("Continuation Token: {0}", result.ResponseContinuation ?? "null");
          var list = result.ToList();
          Console.WriteLine("Document Count: {0}", list.Count);
      }
  </code></pre>
  
  <p>The results I get are strange though </p>
  
  <pre><code>Quota Usage: documentSize=4;documentsSize=4386;documentsCount=37;collectionSize= 4395; 
  
  Continuation Token: null 
  
  Document Count: 36
  </code></pre>
  
  <p>I am not getting the last document ever as the continuation token becomes null after fetching 36 documents while document count does show up as 37. I am struggling to understand this behaviour and is there a way I can make this work to return all the documents.</p>