incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Somers <somers....@gmail.com>
Subject Re: View with datetime values
Date Mon, 06 Apr 2009 08:55:52 GMT
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 <paul.joseph.davis@gmail.com>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 <somers.tim@gmail.com> 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
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message