incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Davis <>
Subject Re: reduce order vs descending
Date Wed, 23 Feb 2011 18:43:08 GMT
2011/2/23 Łukasz Mielicki <>:
> Hi everybody,
> I can observe that order of values provided to reduce function depends
> on descending query parameter.
> Is this a bug?  Or does Couch support left and right reduce separetely?
> Couchbook says: If you specify descending=true, the reading direction
> is reversed, not the sort order of the rows in the view.
> Also my assumption is the reduced values are always provided in key
> order (and [key, _id] for first reduce step). Does it apply to all
> reduce steps then?
> Thanks,
> Łukasz

Never write code that depends on the ordering of keys in reductions.
It will break. The order is undefined and I don't ever see it being
defined due to lots and lots of edge cases in that code.

View raw message