couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Duane Almond Sto. Tomas" <>
Subject problem with two key ranges in couchdb
Date Sat, 02 Jan 2010 13:41:49 GMT
I'm having problem getting the right results in my coordinate system.
To explain my system, I have this simple database that have x_axis, y_axis
and name columns. I don't need to get all the data, I just need to display
some part of it.

For example, I have a coordinate system that have 10:10(meaning from x_axis
-10 to 10 and from y_axis -10 to 10) and I want to display only 49
coordinates. In sql query I can do it something like this:
"select * from coordinate where x_axis >= -3 and x_axis <= 3 and y_axis >=
-3 y_axis <= 3"

I tried this function but no success:

       "by_range": {
           "map": "function(doc) { emit([doc.x_axis, doc.y_axis], doc) }"


I got a wrong results of:

<-- should not display this part -->
<-- end of should not display this part -->
..... up to 3x3

to give you a better understanding of my project here is the screenshot of
that I want to be made:

I wanted a perfect ending.
Now I've learned, the hard way, that some poems don't rhyme, and some
stories don't have a clear beginning, middle, and end.
Life is about not knowing, having to change, taking the moment and making
the best of it, without knowing what's going to happen next......Farewell
Team !

Duane Almond C. Sto. Tomas
OOiP Manila
personal websites:

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