title: Retrieving documents from couchbase view using REST API
body: <p>I'm starting with couchbase 3.01 and I have a question about views.  The documentation I read said you should not include the full document in the index, as it will have a negative impact on both storage and performance.  Now I've created a mapping function and I'm emitting <code>null</code> for the document</p>
  
  <p>e.g.</p>
  
  <pre><code>function(doc, meta) {
    if (doc.entity &amp;&amp; doc.entity == 'desert') {
      emit(doc.type, null);
    }
  }
  </code></pre>
  
  <p>This should create an index for my various types of deserts (cookie, ice cream, cake).  When I save the view, and click the 'Show Results' button in the admin console, I see all of the keys with the associated value of <code>null</code>.  </p>
  
  <p>If I change my mapping function to include the document e.g.</p>
  
  <pre><code>function(doc, meta) {
    if (doc.entity &amp;&amp; doc.entity == 'desert') {
      emit(doc.type, doc);
    }
  }
  </code></pre>
  
  <p>I get the results I expect, but, I'm concerned that this is an anti-pattern.  It seems like there used to be a querystring parameter <code>include_docs</code> which would dereference the document, but it doesn't appear in the documentation.  Should I include the full document in the indexes I generate?  If not, how do I retrieve the document by key?</p>