Your problem is a 2D problem. What you might need is something like geocouch [0], or you could try chained map/reduce views.
[0] https://github.com/couchbase/geocouch -- Matthieu RAKOTOJAONA
Your problem is a 2D problem. What you might need is something like geocouch [0], or you could try chained map/reduce views.
[0] https://github.com/couchbase/geocouch -- Matthieu RAKOTOJAONA