W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2010

Re: [IndexedDB] Multi-value keys

From: Jonas Sicking <jonas@sicking.cc>
Date: Fri, 18 Jun 2010 17:06:41 -0700
Message-ID: <AANLkTikSNwq3fMWkvgtuvvD2dEEMHrW1zEA38Mo92QZl@mail.gmail.com>
To: Mikeal Rogers <mikeal.rogers@gmail.com>
Cc: Webapps WG <public-webapps@w3.org>
On Fri, Jun 18, 2010 at 5:03 PM, Mikeal Rogers <mikeal.rogers@gmail.com> wrote:
> The complex keys are how we do this in CouchDB as well. But, again,
> the sorting algorithm needs to be well defined in order for it work.
>
> http://wiki.apache.org/couchdb/View_collation#Collation_Specification
>
> Most pertinent to your example is how arrays of varying length might
> be ordered, for instance range queries over your example would break
> for [firstName, lastName] if an entry omitted lastName and arrays were
> sorted by length and then by comparison of each item. This is why the
> CouchDB collation algorithm sorts:
>
> ["a"]
> ["b"]
> ["b","c"]
> ["b","c", "a"]
> ["b","d"]
> ["b","d", "e"]

How is that different from what I proposed? I think that was what I
intended to propose, but I might be missing some edge cases :)

I take it that ["a", "z"] would be sorted between ["a"] and ["b"]?

/ Jonas
Received on Saturday, 19 June 2010 00:07:33 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:39 GMT