couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel DeLeo" <devnull...@gmail.com>
Subject Re: Adding attributes to a document in the view?
Date Thu, 18 Dec 2008 17:09:31 GMT
I wasn't expecting these attributes to be saved, just returned (emitted).
And I'll trust that docs are frozen before getting to the map function for
good reason.

Paul, you said that adding an attribute in a view would prevent them from
being incrementally computed.  I am I right in thinking that you're
preempting any request for a feature like this (I wasn't planning on asking
for it)? Is there anything wrong with using a "deep copy" function as a
workaround?

Thanks.

On Thu, Dec 18, 2008 at 9:56 AM, Matthew Wilson <matt@tplus1.com> wrote:

> I'm still a couchdb rookie, and I don't want to sound condescending or
> obnoxious, but the term "view" suggests to me that it should be a
> read-only operation.
>
>
>
> On Thu, Dec 18, 2008 at 11:50 AM, Paul Davis
> <paul.joseph.davis@gmail.com> wrote:
> > What Chris said.  Also, if you're expecting any attributes you add to
> > the document to be saved to the database that'll never happen. Views
> > need to satisfy some properties to ensure that views can be
> > incrementally computed. Adding attributes in a view would be a sure
> > fire way to start breaking these requirements.
> >
> > Paul
> >
> > On Thu, Dec 18, 2008 at 11:41 AM, Daniel DeLeo <devnullian@gmail.com>
> wrote:
> >> Is it possible in the newer versions to add attributes to a document
> object
> >> in the view?  For example, on 0.8.0, if your view map function is:
> >>
> >> function(doc) {
> >>  doc.computed_attribute = 'hello, world';
> >>  emit(doc._id, doc);
> >> };
> >>
> >> The view gives a 50X error, and a stack trace in futon.  Is it possible
> to
> >> do this in any version of Couch?
> >>
> >> Thanks,
> >> Dan DeLeo
> >>
> >
>
>
>
> --
> Matthew Wilson
> matt@tplus1.com
> http://tplus1.com
>

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