couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benoit Chesneau <bchesn...@gmail.com>
Subject Re: altering 'doc' variable in map function affects other map functions
Date Mon, 25 Oct 2010 03:40:33 GMT
On Mon, Oct 25, 2010 at 2:52 AM, Adam Kocoloski <kocolosk@apache.org> wrote:
> On Oct 24, 2010, at 4:42 PM, afters wrote:
>
>> Hello couchers,
>>
>> I have the following two map functions (v1.0.1):
>>
>> function (doc) {
>>   emit(doc.path[0], null);
>> }
>>
>> function (doc) {
>>  doc.path = [ 'an intruder from another view' ];
>> }
>>
>> When the views are built, the first map function sees a 'doc' variable that
>> was changed by the second map function! and thus emits the key 'an intruder
>> from another view'.
>>
>> The real documents remain untouched.
>>
>> Besides being a great way for map functions to communicate with each other,
>> I assume it's also a bug?
>>
>>
>> a.
>
> Well, yes.  At one point map functions in a single view group were supposed to be protected
from one another, but that's been broken for a long time, and I'm not sure about an ETA for
restoring it.
>
> Adam
>
>

Hum,

That's a serious bug imo (didn't saw it on my stuff) and thought it
was fixed . Any idea when it was introduced ?

- benoît

Mime
View raw message