by_range?startkey=[-3,-3]&endkey=[3,3]
You use this as a WHERE clause. Couchdb does not understand the meaning of "startkey" and "endkey", it just uses them to know when to start and stop outputting results.
For example, take the following result set:
doc1
doc2
doc3
doc4
If I applied this query:
StartKey = doc2 &? EndKey = doc3
The result set will be:
doc2
doc3
To apply the range in your example, I would change the map function:
function(doc) {
if (doc.x <= 3 && doc.x >= -3 && doc.y <= 3 && doc.y >= -3)
emit([doc.x, doc.y], doc)
}
:
CouchDB:
" CouchDB , , ".
, , , .
function(doc) {
emit(doc.x * doc.y, doc)
}
:
by_range?startkey=-9&endkey=9
, -
startkey = (x1*y1)
endkey = (x2*y2)