couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Pierre Fiset>
Subject Suppressing duplicate documents from a view query
Date Fri, 10 Dec 2010 14:08:25 GMT
This question relates to CouchDb 1.0.1.

I have been reading as much as I can about CouchDb and started implementing an application.
seem to remember that there is a request flag that can be passed to a view query to eliminate
document duplicates. However, I do not recall which one it is. A quick review of the wiki
not shed any light.

Currently, I am removing duplicates by using a list function. I have documented the details
the list function here:

In short, this is the list function:

function(head, req) {
    var ids = {}
        ,first = true
    while(row = getRow()) {
        if( !ids[] ) {
            if( first ) {
                first = false;
            } else {
                send( ',' );
            send( toJSON(row) );
            ids[] = 1;

1. Is there a much simpler way to achieve this?
2. If the list function is the way to solve the problem, can someone comment on the likelihood
that this function will sustain the scaling up of the database?



View raw message