couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cesar Delgado <beett...@ymail.com>
Subject Re: Question on selecting on reduce values
Date Sat, 01 May 2010 19:04:17 GMT
That's awesome Randall, thanks.  I have to play around with it a little more but at least I
got something useful now.

I just created a list that looks like this:

function(head, req) {
    var row ;
    while (row = getRow()) {
        if (row.value > 1){      
      send(row.key + "\n") ;    
    }  
  }
}

True that what I'm getting returned is just the name of the duplicated entries, but it's a
good start.

Cheers!

-Cesar



________________________________
From: Randall Leeds <randall.leeds@gmail.com>
To: user@couchdb.apache.org
Sent: Fri, April 30, 2010 5:52:48 PM
Subject: Re: Question on selecting on reduce values

Reading all the way through I'm convinced it should work as I explained.
Pass an extra query parameter not recognized by the view server and inspect
it in the list function.

Voila!

On Apr 30, 2010 5:49 PM, "Randall Leeds" <randall.leeds@gmail.com> wrote:

I believe you could accomplish what you want with a list function:

http://books.couchdb.org/relax/design-documents/lists

I've never used one myself, but my impression is that you could simply not
send() any data for rows that have less than some number for the value.

Of course, I don't know if you can do group reduce with a list function. Can
any devs chime in on whether couch still obeys query strings and allows a
group reduce to be sent to a list?

Ideally you could send in your variable threshold as an additional query
parameter, available to the list function in the request object.

Something to play with and if it can't be made to work now my gut says it
should be possible and there's a patch to be made.

Again, disclaimer: never used a list function and answering from my phone.

-Randall

Sent from my mind control space transport super-dome.


>
> On Apr 30, 2010 4:44 PM, "Cesar Delgado" <beettlle@ymail.com> wrote:
>
> I've had a map/reduce ...

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