Class: MrMongo::MapReduce
- Inherits:
-
Object
- Object
- MrMongo::MapReduce
- Defined in:
- lib/mr_mongo/map_reduce.rb
Instance Attribute Summary collapse
-
#collection ⇒ Object
Returns the value of attribute collection.
-
#finalize ⇒ Object
Returns the value of attribute finalize.
-
#js_mode ⇒ Object
Returns the value of attribute js_mode.
-
#limit ⇒ Object
Returns the value of attribute limit.
-
#map ⇒ Object
Returns the value of attribute map.
-
#out ⇒ Object
Returns the value of attribute out.
-
#query ⇒ Object
Returns the value of attribute query.
-
#reduce ⇒ Object
Returns the value of attribute reduce.
-
#scope ⇒ Object
Returns the value of attribute scope.
-
#sort ⇒ Object
Returns the value of attribute sort.
-
#verbose ⇒ Object
Returns the value of attribute verbose.
Instance Method Summary collapse
- #exec ⇒ Object
- #exec_on_memory ⇒ Object
-
#initialize(context) ⇒ MapReduce
constructor
A new instance of MapReduce.
- #insert_into_collection(*args) ⇒ Object (also: #insert)
- #to_options ⇒ Object
Constructor Details
#initialize(context) ⇒ MapReduce
Returns a new instance of MapReduce.
6 7 8 |
# File 'lib/mr_mongo/map_reduce.rb', line 6 def initialize(context) @context = context end |
Instance Attribute Details
#collection ⇒ Object
Returns the value of attribute collection.
3 4 5 |
# File 'lib/mr_mongo/map_reduce.rb', line 3 def collection @collection end |
#finalize ⇒ Object
Returns the value of attribute finalize.
3 4 5 |
# File 'lib/mr_mongo/map_reduce.rb', line 3 def finalize @finalize end |
#js_mode ⇒ Object
Returns the value of attribute js_mode.
3 4 5 |
# File 'lib/mr_mongo/map_reduce.rb', line 3 def js_mode @js_mode end |
#limit ⇒ Object
Returns the value of attribute limit.
3 4 5 |
# File 'lib/mr_mongo/map_reduce.rb', line 3 def limit @limit end |
#map ⇒ Object
Returns the value of attribute map.
3 4 5 |
# File 'lib/mr_mongo/map_reduce.rb', line 3 def map @map end |
#out ⇒ Object
Returns the value of attribute out.
3 4 5 |
# File 'lib/mr_mongo/map_reduce.rb', line 3 def out @out end |
#query ⇒ Object
Returns the value of attribute query.
3 4 5 |
# File 'lib/mr_mongo/map_reduce.rb', line 3 def query @query end |
#reduce ⇒ Object
Returns the value of attribute reduce.
3 4 5 |
# File 'lib/mr_mongo/map_reduce.rb', line 3 def reduce @reduce end |
#scope ⇒ Object
Returns the value of attribute scope.
3 4 5 |
# File 'lib/mr_mongo/map_reduce.rb', line 3 def scope @scope end |
#sort ⇒ Object
Returns the value of attribute sort.
3 4 5 |
# File 'lib/mr_mongo/map_reduce.rb', line 3 def sort @sort end |
#verbose ⇒ Object
Returns the value of attribute verbose.
3 4 5 |
# File 'lib/mr_mongo/map_reduce.rb', line 3 def verbose @verbose end |
Instance Method Details
#exec ⇒ Object
26 27 28 |
# File 'lib/mr_mongo/map_reduce.rb', line 26 def exec () end |
#exec_on_memory ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/mr_mongo/map_reduce.rb', line 30 def exec_on_memory = [:out] = {inline: true} [:raw] = true () end |
#insert_into_collection(*args) ⇒ Object Also known as: insert
38 39 40 |
# File 'lib/mr_mongo/map_reduce.rb', line 38 def insert_into_collection(*args) mongo_collection.send(:insert, *args) end |
#to_options ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/mr_mongo/map_reduce.rb', line 10 def = {} [:query] = @query if defined?(@query) [:sort] = @sort if defined?(@sort) [:limit] = @limit if defined?(@limit) [:finalize] = @finalize if defined?(@finalize) [:out] = @out if defined?(@out) [:verbose] = @verbose if defined?(@verbose) [:scope] = @scope if defined?(@scope) [:raw] = true if defined?(@out) and @out.is_a?(::Hash) and @out[:inline] end |