Class: SimplyCouch::Model::View::RawViewSpec
- Inherits:
-
BaseViewSpec
- Object
- BaseViewSpec
- SimplyCouch::Model::View::RawViewSpec
- Defined in:
- lib/simply_couch/model/view/raw_view_spec.rb
Overview
A view for custom map/reduce functions that returns the raw data from couchdb
example:
view :my_custom_view, :map => "function(doc) { emit(doc._id, null); }", :type => :raw, :reduce => nil
optionally you can pass in a results filter which you can use to process the raw couchdb results before returning them
example:
view :my_custom_view, :map => "function(doc) { emit(doc._id, null); }", :type => :raw, :results_filter => lambda{|results| results['rows'].map{|row| row['value']}}
example:
view :my_custom_view, :map => "function(doc) { emit(doc._id, null); }", :type => :raw, :lib => {:module => "exports.name = 'module';"}
Constant Summary
Constants inherited from BaseViewSpec
BaseViewSpec::DEFAULT_DIGEST_VIEW_NAMES, BaseViewSpec::DEFAULT_LANGUAGE
Instance Attribute Summary
Attributes inherited from BaseViewSpec
#design_document, #language, #list_function, #list_name, #view_name, #view_parameters
Instance Method Summary collapse
Methods inherited from BaseViewSpec
Constructor Details
This class inherits a constructor from SimplyCouch::Model::View::BaseViewSpec
Instance Method Details
#lib ⇒ Object
24 25 26 |
# File 'lib/simply_couch/model/view/raw_view_spec.rb', line 24 def lib [:lib] end |
#map_function ⇒ Object
16 17 18 |
# File 'lib/simply_couch/model/view/raw_view_spec.rb', line 16 def map_function [:map] end |
#reduce_function ⇒ Object
20 21 22 |
# File 'lib/simply_couch/model/view/raw_view_spec.rb', line 20 def reduce_function [:reduce] end |