incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mathieu Castonguay <mcastong...@justlexit.com>
Subject question about ranges
Date Mon, 23 Apr 2012 18:27:36 GMT
I have a very simple model with a list of lists of integers, ie
[[11000,20000],[23000,40000],[61400,62200],[71400,72200]]

I have a view which loops through these and emits them

"test6": {
           "map": "function(doc) { if (doc.ranges) { for (var x in
doc.ranges) { emit(doc.ranges[x], doc._id) }}}"
       },



and then I basically want to pull the ones that are within my range:

test6?startkey=[52000,0]&endkey=[74000,64000]

this returns:

{"total_rows":7,"offset":5,"rows":[
{"id":"059a2e3b15364dcdfe412a6998021832","key":[61400,62200],"value":"059a2e3b15364dcdfe412a6998021832"},
{"id":"059a2e3b15364dcdfe412a6998021832","key":[71400,72200],"value":"059a2e3b15364dcdfe412a6998021832"}
]}


But what I was expecting is to only see the [61400,62200] because i thought
that with this query I was doing [Between(52000,74000),Between(0,64000)]

There's obviously something wrong with my logic, can someone lend a hand?

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message