distinct on first author
[angular-drzb] / angular-server.pl
index 94c84ad..e6298fc 100755 (executable)
@@ -296,7 +296,7 @@ function(doc) {
        } elsif ( $format eq 'key_distinct' ) {
 
                my $found;
-               $json->{rows} = [ grep { $found->{ $_->{key} }++ == 1 } @{ $json->{rows} } ];
+               $json->{rows} = [ grep { ++$found->{ $_->{key} } == 1 } @{ $json->{rows} } ];
                $json->{distinct_rows} = scalar @{ $json->{rows} };
                warn "## distinct stats ", dump( $found );