incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jon Gretar Borgthorsson <jon.borgthors...@gmail.com>
Subject Re: Sorting padded numbers?
Date Wed, 17 Mar 2010 11:26:27 GMT
If you get sorting like that it means that you have strings but not numbers.
Either start using numbers for the values or if that is not possible convert
the string to an integer in the emit function.

   emit(parseInt(doc.my_number), doc);

-- Jón Grétar Borgþórsson


On Wed, Mar 17, 2010 at 11:05 AM, 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?
>
>
> Thanks,
>
> Luis
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message