incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Goodlad <da...@goodlad.ca>
Subject Re: Sorting padded numbers?
Date Wed, 17 Mar 2010 11:23:45 GMT
On Wed, Mar 17, 2010 at 10:05 PM, Luis Gomez <lgomez@gmail.com> wrote:
> Hi, quick one this time...
>
> How can I make a map function sort these keys numerically? Is there an
> easy/conventional way or do I need to pad the numbers?

Hi Luis

Emitting integer keys instead of strings will cause it to sort properly:

function(doc) { emit(parseInt(doc.yourval), "foo" }

Dave

Mime
View raw message