couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luke Driscoll <luke.drisc...@gmail.com>
Subject Re: Complex Keys and Ranges
Date Fri, 11 Jun 2010 16:00:31 GMT
I should also add that on second look, where I said:
> However, if I remove the "platform" from the key and search
> startkey = [2010, 05, "", 1], endkey = [2010, 05, "\u9999", 12]
> it works as expected.

I was, in fact, wrong.

On Fri, Jun 11, 2010 at 11:57, Luke Driscoll <luke.driscoll@gmail.com>wrote:

> Thanks Bob, I thought it was going to be something like that.  I'll have to
> create separate views for this then.
>
>
> On Fri, Jun 11, 2010 at 11:52, Robert Newson <robert.newson@gmail.com>wrote:
>
>> You can only query contiguous ranges of keys with startkey/endkey.
>>
>> [2010, 05, "", "", 13] is lower than [2010, 05, "\u9999", "\u9999",
>> 12] and is therefore included.
>>
>> B.
>>
>> On Fri, Jun 11, 2010 at 4:46 PM, Luke Driscoll <luke.driscoll@gmail.com>
>> wrote:
>> > All,
>> > I'm sorry if this question has been answered before, but I took a look
>> at
>> > the archives and couldn't find the answer that quite covers it.
>> >
>> > I have a complex key of
>> > [year, month, "user name", "platform", day]
>> >
>> > The reason that I did it this way (put day at the end) is because I need
>> to
>> > be able to reduce to a group level of "year, month" as well as "year,
>> month,
>> > user", "year, month, user, platform" and "year, month, user, platform,
>> day".
>> >  And I didn't want to create multiple views because the data are the
>> same
>> >
>> > Now, when I search for date ranges like this:
>> > startkey = [2010, 05, "", "", 1], endkey = [2010, 05, "\u9999",
>> "\u9999",
>> > 12]
>> > it gives me the results for the whole of May, rather than just the first
>> > twelve days.
>> >
>> > However, if I remove the "platform" from the key and search
>> > startkey = [2010, 05, "", 1], endkey = [2010, 05, "\u9999", 12]
>> > it works as expected.
>> >
>> > Can you give me some pointers as to what I'm doing wrong, or give me
>> some
>> > suggestions as to how to do this better.
>> >
>> > Thanks in advance,
>> > Luke
>> >
>>
>
>

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