Class: CouchPotato::View::RawViewSpec
- Inherits:
-
BaseViewSpec
- Object
- BaseViewSpec
- CouchPotato::View::RawViewSpec
- Defined in:
- lib/couch_potato/view/raw_view_spec.rb
Overview
A view for custom map/reduce functions that returns the raw data fromcouchdb
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';"
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 CouchPotato::View::BaseViewSpec
Instance Method Details
#lib ⇒ Object
23 24 25 |
# File 'lib/couch_potato/view/raw_view_spec.rb', line 23 def lib [:lib] end |
#map_function ⇒ Object
15 16 17 |
# File 'lib/couch_potato/view/raw_view_spec.rb', line 15 def map_function [:map] end |
#reduce_function ⇒ Object
19 20 21 |
# File 'lib/couch_potato/view/raw_view_spec.rb', line 19 def reduce_function [:reduce] end |