Format for start and end keys when making REST calls

Hi,

I’ve got my views setup. Now I want to filter the results based on startKey and endKey. I’ve constructed my query string as such:

?group=true&group_level=1&endKey=%5B%22test_7%22%2C%7B%7D%5D&startKey=%5B%22test_7%22%5D

which the startKey and and endKey is based on this object:

var queryParams = { startKey : JSON.stringify([‘test_7’]), endKey : JSON.stringify([‘test_7’, {}]) }

But when I invoke the API I still get back all the rows.

Looking for suggestions on resolving this.

Thanks,

Adrian

The parameter names are startkey and endkey.

http://developer.couchbase.com/documentation/mobile/1.2/develop/references/couchbase-lite/rest-api/design-document/get---db--design--design-doc--view--view-name-/index.html

Doh!!

Thanks. But now the “rows” array is empty.

Figured it out. The second array element should not be used if I’m only defining a single element array key.

Thanks for your help @jens