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,

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

Reply via email to