Hi,

I've added a note to the wiki at
http://wiki.apache.org/couchdb/Intoduction_to_CouchDB_views. Since it's my
first time, could you please check if it's okay and in the right place?

Thanks
Tim


On Fri, Apr 3, 2009 at 4:02 PM, Paul Davis <[email protected]>wrote:

> emit works by just storing the key/value pairs in an array and then
> when all views in the same _design document have been calculated
> returns all results at once. As you've noticed this can lead to the
> pass by reference confusion.
>
> Feel free to add a note to the wiki.
>
> Paul Davis
>
> On Fri, Apr 3, 2009 at 7:46 AM, Tim Somers <[email protected]> wrote:
> > Hi guys,
> >
> > Okay, I found what's going on. Calling the "emit" function passes the
> > object's reference, so if I alter the object afterwards, the emited value
> > gets altered with it. I fixed it by changing
> > emit([doc.monitorID, doc.LocDateTime], subDateTime);
> > to
> > emit([doc.monitorID, doc.LocDateTime], eval(uneval(subDateTime)));
> > which seems to work.
> >
> > This does leave me with a question: is this intended behavior? If so,
> maybe
> > it should at least be mentioned in the docs?
> >
> > Thanks
> > Tim
> >
>

Reply via email to