Rewriting complex query in a view

To have a multiple where clause condition as you’ve defined above is possible but it would likely require emitting multiple entries for a single document in order to group by specific geohashes and parameterizing the query at runtime would be a challenge.

Alternatively CB 4.0 can easily perform this SQL query as you’ve defined it above. The developer preview is being released this month.

http://www.couchbase.com/coming-in-couchbase-server-4-0