views and reduce functions for couchbase