couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rajkumar S" <rajkum...@gmail.com>
Subject Arguments for Reduce function
Date Wed, 17 Dec 2008 15:43:20 GMT
Hi,

I have a (simplified) reduce function like


function(key,values){
    var a,b;
        for (var i=0; i< values.length; ++i) {
            if (values[i] < 6){
                a++;
            } else {
                b++;
            }
        }
    }
    return [values.length,a,b];
}

The value 6 here is hard coded, is it possible to pass this via some
sort of arguments? Also how can I retrieve all results of a view ?

Thanks and regards,

raj

Mime
View raw message