Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Feb 1, 2012

Conversation

jnisenson
Copy link

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);}"
}

@janmonschke
Copy link
Owner

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

@jnisenson
Copy link
Author

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

@janmonschke
Copy link
Owner

That was quick :) Thx!

janmonschke added a commit that referenced this pull request Feb 1, 2012
Fix for "include_docs : true" when the view emits a null value
@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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants