couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Davis" <paul.joseph.da...@gmail.com>
Subject Re: Array key queries
Date Fri, 12 Dec 2008 21:08:21 GMT
Yes.

null sorts before anything and {} sorts after any digit, string,
special keyword and array (Pretty sure it's after array anyway).

In the case of [null, 0], [{}, 0], the second element of the array is
never consulted for your example keys because the first element
provides all information needed in the sort.

Hopefully that makes more sense than I think it might.

Paul

On Fri, Dec 12, 2008 at 3:59 PM, Paul Carey <paul.p.carey@gmail.com> 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
>

Mime
View raw message