couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Candler <>
Subject View keys case-insensitive?
Date Thu, 09 Apr 2009 10:53:30 GMT
I was very surprised to find that view keys seem to be case-insensitive when
using startkey and endkey:

$ curl -X POST -d '{"map":"function(doc) { emit(, null); }"}' '"a"&endkey="az"'
{"id":"8","key":"A","value":null},    <<<< huh?!

But not when fetching them individually:

$ curl -X POST -d '{"map":"function(doc) { emit(, null); }"}' '"a"'
$ curl -X POST -d '{"map":"function(doc) { emit(, null); }"}' '"A"'

(Ditto for startkey="a"&endkey="a", or startkey="A"&endkey="A")

At it says that view keys are
case-sensitive, which normally means that "A" does not appear in the range
"a" to "aa". And with normal ASCII ordering I would expect "A" to sort
before "a", as is the case with Javascript:

js> "a" < "A"

Could someone please explain to me what's going on? This may also explain my
recent report COUCHDB-324 where tilde does not collate where I'd expect.

I am running a recent SVN build:



View raw message