Fix for "include_docs : true" when the view emits a null value #35

merged 2 commits into from Feb 1, 2012


None yet

2 participants


This fix handles the case where include_docs is true and the view emits only the key and null. When the view value is null we check to see if the doc exists in the returned data (as it will when include_docs is true)

Example for a couchapp view with a complex key:
"by_test_type_date" : {
"map": "function (doc) { emit([doc.test_type, doc.created_at], null);}"


Looks good, can you provide the CoffeeScript source as well and recompile it then?
This is the part of the CS doc for conditionals:


Here is the pull request that includes the .coffee fix as well using:

if doc.value then _temp.push doc.value else _temp.push doc.doc


That was quick :) Thx!

@janmonschke janmonschke merged commit de45b6b into janmonschke:master Feb 1, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment