In the View Collation chapter of the CouchDB official documentation under the first example (http://docs.couchdb.org/en/1.6.1/couchapp/views/collation.html#views-collation), it is suggested that it is not recommended to emit the document itself in the view and instead, it is suggested to include the bodies of the documents when requesting the view, by requesting the view with ?include_docs=true.
If I understood it correctly, instead of:
emit(doc._id, doc);
and getting results in the following format:
{"id":"1","key":"1","value":{"_id": "1", "someProp": "someVal"}},
it is suggested to send emits with null values:
emit(doc._id, null)
and then when querying my view with the include_docs parameter get results in the following format:
{
"id": "1",
"key": "1",
"value": null,
"doc": {
"_id": "1",
"_rev": "1-0eee81fecb5aa4f51e285c621271ff02",
"someProp": "someVal"
}
If it is suggested, than I would presume the performance of that would be better, but unfortunately the documentation doesn't elaborate why and other examples emit documents normally as value in the emit. Could anyone shed more light on this?