Simulating SQL BETWEEN quuery

Thanks

Actually, In my use case, i do not know the lower and upper bound. I need to find the range it falls in, given a number. Anyway, i solved it like following
View is like this
function (doc, meta) {
if(doc.type=‘blocks’)
emit(doc.endNum, doc.locationId);
}

and then query with startKey={number} and limit=1

and yes, ranges are not overlapping. A number can only fall in one range.