couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Davis" <>
Subject Re: Sorting views with composite keys
Date Sun, 05 Oct 2008 18:14:39 GMT
Right now I don't know that this is possible. Other than figuring out
some way of getting your second key to sort descending by having it
sorted ascending. Ie, if it were a timestamp, have it reefrence
something in the future, which is awfully hackish.

There *might* be a method for this with the custom correlation stuff,
but I don't know that this sort of fine grained control would be


On Sun, Oct 5, 2008 at 12:25 PM, Nick Johnson <> wrote:
> How would I construct a view with two keys, a and b, sorted first by a
> ascending, then by b descending? Composite keys are easy enough to generate,
> but the key [a,b] would only permit sorting both in ascending order (or both
> in descending order, if we scan in reverse). Can anyone suggest a way of
> modifying the keys to support heterogenous sort orders like this? My best
> idea so far is a monstrosity involving hex-encoded binary data. :)

View raw message