couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Cottlehuber <d...@muse.net.nz>
Subject Re: Hierarchical comments Hacker News style
Date Mon, 21 May 2012 07:34:04 GMT
On 21 May 2012 04:42, Jim Klo <jim.klo@sri.com> wrote:

> If you're trying to sort hierarchically using integers as id's, assuming
> the id's grow incrementally with time (say you were using local_seq), the
> arrays will naturally sort numerically, whereas strings are going to sort
> alphanumerically,  meaning 2, 3, 22, 33 vs "2", "22", "3","33".
>
> Hence,
>
> [ 1, 2 ]
> [ 1, 3 ]
> [ 1, 3, 10 ]
> [ 1, 22 ]
> [ 1, 22, 4 ]
> [ 1, 22, 5 ]
>
> Which is what I think your intended sort order?
>

That's a useful tip - thanks Jim!

A+
Dave

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