def query(path, opts={})

      opts = opts.dup
        # don't touch the original

      raw = opts.delete(:raw)

      path = if DESIGN_PATH_REGEX.match(path)
        path
      else
        doc_id, view = path.split(':')
        path = "_design/#{doc_id}/_view/#{view}"
      end

      path = adjust(path)

      adjust_params(opts)

      keys = opts.delete(:keys)

      res = if keys
        opts[:cache] = :with_body if opts[:cache].nil?
        @http.post(path, { 'keys' => keys }, opts)
      else
        @http.get(path, opts)
      end

      return nil if res == true
        # POST and the view doesn't exist

      return res if raw

      res.nil? ? res : res['rows']
    end
def query(path, opts={})

      opts = opts.dup
        # don't touch the original

      raw = opts.delete(:raw)

      path = if DESIGN_PATH_REGEX.match(path)
        path
      else
        doc_id, view = path.split(':')
        path = "_design/#{doc_id}/_view/#{view}"
      end

      path = adjust(path)

      adjust_params(opts)

      keys = opts.delete(:keys)

      res = if keys
        opts[:cache] = :with_body if opts[:cache].nil?
        @http.post(path, { 'keys' => keys }, opts)
      else
        @http.get(path, opts)
      end

      return nil if res == true
        # POST and the view doesn't exist

      return res if raw

      res.nil? ? res : res['rows']
    end
Queries a view.

   res = couch.query('_design/my_test/_view/my_view')
     
     #   [ {"id"=>"c3", "key"=>"capuccino", "value"=>nil},
     #     {"id"=>"c0", "key"=>"espresso", "value"=>nil},
     #     {"id"=>"c2", "key"=>"macchiato", "value"=>nil},
     #     {"id"=>"c4", "key"=>"macchiato", "value"=>nil},
     #     {"id"=>"c1", "key"=>"ristretto", "value"=>nil} ]

   # or simply :

   res = couch.query('my_test:my_view')

 Accepts the usual couch parameters : limit, skip, descending, keys,
 startkey, endkey, ...