I wonder if we could pass variables as parameters to a map function in CouchDb.
Practically, I have a database with coordinates of places, and I only want to map/reduce the places that are within reach of a point. How could I do that? I want something like:
function(doc, x, y, radius) {
if (doc.x - x)^2 + (doc.y - y)^2 < radius^2 {
emit(doc._id, doc);
}
}
How can we do that in CouchDb?
You have 3 options:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With