You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "Walt W (JIRA)" <ji...@apache.org> on 2010/04/08 20:59:36 UTC

[jira] Created: (COUCHDB-729) View Generation: emit() not instantaneous

View Generation: emit() not instantaneous
-----------------------------------------

                 Key: COUCHDB-729
                 URL: https://issues.apache.org/jira/browse/COUCHDB-729
             Project: CouchDB
          Issue Type: Bug
          Components: JavaScript View Server
         Environment: Using Win7
            Reporter: Walt W


Try the following view function:

function(doc) {
  var tmp = { result: 'a' };
  emit(null, tmp);
  tmp.result = 'b';
  emit(null, tmp);
}

The unfortunate happening is that (null, { result: 'b' }) is emitted twice per document, rather than one 'a' and one 'b'.  I would think that the emit function should grab and copy the values passed immediately; it does not make sense or seem useful (to me anyway) to allow them to change after the fact.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (COUCHDB-729) View Generation: emit() not instantaneous

Posted by "Paul Joseph Davis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-729?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul Joseph Davis updated COUCHDB-729:
--------------------------------------

    Skill Level: Regular Contributors Level (Easy to Medium)

> View Generation: emit() not instantaneous
> -----------------------------------------
>
>                 Key: COUCHDB-729
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-729
>             Project: CouchDB
>          Issue Type: Bug
>          Components: JavaScript View Server
>         Environment: Using Win7
>            Reporter: Walt W
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> Try the following view function:
> function(doc) {
>   var tmp = { result: 'a' };
>   emit(null, tmp);
>   tmp.result = 'b';
>   emit(null, tmp);
> }
> The unfortunate happening is that (null, { result: 'b' }) is emitted twice per document, rather than one 'a' and one 'b'.  I would think that the emit function should grab and copy the values passed immediately; it does not make sense or seem useful (to me anyway) to allow them to change after the fact.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.