couchdb-user mailing list archives

On Fri, Dec 12, 2008 at 4:09 PM, Adam Kocoloski
<adam.kocoloski@gmail.com> wrote:
> Hi Paul, yes it is. The startkey/endkey filtering can only select a
> continuous range in the keyspace, and the keys are sorted by the first
> element in the array (first). If you happened to have row in that view with
> a key [{}, 1], your second query would have suppressed it.
>
> I realize that filtering on an arbitrary position in the array would be
> sweet, but it would be quite a lot more work for the server. I'm not a
> member of the development team, but I'll bet that kind of functionality will
> only appear if CouchDB's flavor of MapReduce grows support for a remap
> phase. Best,
>
On a side note, one of my github branches is a custom sort order patch
for views that allows for declaring ascending or descending sort order
for each position in an array key.
> Adam
>
> On Dec 12, 2008, at 3:59 PM, Paul Carey wrote:
>
>> Querying with an array based key produces inconsistent results across
>> different key indexes.
>>
>> For example, consider a view that emits the following keys
>>
>> [0, 0]
>> [0, 1]
>> [1, 0]
>> [1, 1]
>>
>> Querying with startkey=[0, null] and endkey=[0, {}] returns
>>
>> [0, 0]
>> [0, 1]
>>
>> However, querying with startkey=[null, 0] and endkey=[{}, 0] does not
>> return
>>
>> [0, 0]
>> [1, 0]
>>
>> Instead, all rows are returned.
>>
>> Is this the expected behaviour?
>>
>> Thanks
>> Paul
>
>