couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jens Alfke <>
Subject Re: question about "complex" range queries
Date Thu, 03 Apr 2014 14:04:20 GMT

On Apr 3, 2014, at 5:53 AM, Scott Weber <> wrote:

> Are you saying that it is NOT something that should be relied on?

Bob Newson just said that pretty emphatically.

If you want your index to be sorted in a particular way, then emit keys that sort that way!
Don’t try to find some undocumented hack that lets you get away without emitting properly
ordered keys.

> I also notice that the documents are sent into the view already sorted by their _id.
 Is that a behavior that CAN be replied on?

Definitely not. And a properly written map function shouldn’t care anyway — if your map
function uses any sort of external state that could distinguish the order in which docs are
passed to it, then You’re Doing It Wrong.

View raw message