How To work with values at reduce functions?

Try using the Elasticsearch plugin.
Store the json docs in couchbase and XDCR the doc to ElasticSearch. In ElasticSearch you can do ad-hoc and very complex queries better then SQL.
Elasticsearch will bring back a json list of couchbase keys.
In the couchbase SDK do a BulkGet(array_of_keys_in_couchbase) BOOM under a 1 millisecond.

Remember to do not have Elasticsearch store the whole doc or else the rest response from Elasticsearch will kill your speed.

You can get the plugin here http://docs.couchbase.com/couchbase-elastic-search/