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

Projects
None yet
2 participants
@jnisenson

jnisenson commented Jan 31, 2012

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

This comment has been minimized.

Show comment
Hide comment
@janmonschke

janmonschke Feb 1, 2012

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

Owner

janmonschke commented Feb 1, 2012

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

This comment has been minimized.

Show comment
Hide comment
@jnisenson

jnisenson Feb 1, 2012

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

jnisenson commented Feb 1, 2012

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

This comment has been minimized.

Show comment
Hide comment
@janmonschke

janmonschke Feb 1, 2012

Owner

That was quick :) Thx!

Owner

janmonschke commented Feb 1, 2012

That was quick :) Thx!

janmonschke added a commit that referenced this pull request Feb 1, 2012

Merge pull request #35 from jnisenson/master
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