Order and range at the same time in views


#1

Hi,

I use a view for accesing my data because is more fast and I want to filter and order through data using the request parameters.

My view key is [value1,value2] and what I want to do is get all the elements with value1 between minValue1 and maxValue1 and value2 between minValue2 and maxValue2 and I want to order them by value1 .

I tried using only range with startKey = [minValue1,minValue2] and endKey=[maxValue2,maxValue2] and the result is order by value1 and is contains only elements with value1 between minValue1 and maxValue1 but is not respect the value2 condition which is not only between minValue2 and maxValue2 and also return values from outside the range.

So my question is whi is not this working shouldn’t he get all the elements with value1 > minValue1 and value2 > minValue2 or I get it wrong and is first get the elements with value1 > minValue1 and doesn’t care about the second value in the key ?
And if this way is wrong is there a possibility to do this ?