Search with startkey, endkey and array keys

I have a view that returns multiple elements using array keys.
Example:

{"total_rows":4,"offset":0,"rows":[
    {"id":"","key":[15,"2"],"value":1,"doc":{},
    {"id":"","key":[20,"2"],"value":1,"doc":{},
    {"id":"","key":[20,"3"],"value":1,"doc":{},
    {"id":"","key":[20,"4"],"value":1,"doc":{}
]}

I am trying to search on these items. Therefore, if I make the following request:

/database/_design/element/_view/all/?
  startkey=[15, "2"]&
  endkey=[20, "3"]&
  include_docs=true&reduce=false

Real-time example: http://jchris.couchone.com/keyhuh/_design/Record/_view/by_CreationDate_and_BoreholeName?startkey=►1267686720,%22sp4%22.06.2012&endkey=[1267686725,%22sp4 \ u9999% 22] & include_docs = true & decrease = false

This does not work. It returns to me all the records, even the last ones, which do not correspond to the second element of the array.

Oddly enough, it only works with strings.
Example:

{"total_rows":4,"offset":0,"rows":[
    {"id":"","key":["15","2"],"value":1,"doc":{},
    {"id":"","key":["20","2"],"value":1,"doc":{},
    {"id":"","key":["20","3"],"value":1,"doc":{},
    {"id":"","key":["20","4"],"value":1,"doc":{}
]}

if I make the following request:

/database/_design/element/_view/all/?
  startkey=["15", "2"]&
  endkey=["20", "3"]&
  include_docs=true&
  reduce=false

Live : http://jchris.couchone.com/keyhuh/_design/Record/_view/by_Client_and_BoreholeName?startkey=[%22Test1%22,%22sp4%22]&endkey=[%22Test1%22,%22sp4\u9999% 22] & include_docs = true & = false

.

- couchdb ? ?

: CouchDB 0.10 0.11.

+3

Source: https://habr.com/ru/post/1751596/


All Articles