Format for start and end keys when making REST calls


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:


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.



The parameter names are startkey and endkey.


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