javascript - complex startkey/endkey query concerning PouchDB not returning expected result -
i have created index called session_indexes/by_lastmodifieddate_status in pouchdb emit both timestamp string, indicates status. here array keys emitted when map function run 6 documents in database: [1404446400000, 'suspended'] [1409630400000, 'open'] [1413777600000, 'open'] [1423976400000, 'closed'] [1425704400000, 'open'] [1430193600000, 'open'] now, want query index using startkey , endkey . providing following: startkey: [1422766800000, 'closed'] endkey: [1427688000000, 'closed'] this means want find of documents have date between these 2 timestamps , have closed status. however, pouchdb seems return results match dates - it's returning 2 results (the other 1 being [1425704400000, 'open'] ). the map function using follows. know looks strange - being generated code. not written human. still emits correct keys fine: function(document) { if(document._id.startswith('session')) {...