lib/mongoid/contextual/map_reduce.rb in mongoid-3.0.23 vs lib/mongoid/contextual/map_reduce.rb in mongoid-3.1.0
- old
+ new
@@ -4,11 +4,11 @@
class MapReduce
include Enumerable
include Command
delegate :[], to: :results
- delegate :==, :empty?, :inspect, to: :entries
+ delegate :==, :empty?, to: :entries
# Get all the counts returned by the map/reduce.
#
# @example Get the counts.
# map_reduce.counts
@@ -159,9 +159,20 @@
#
# @since 3.0.0
def raw
results
end
+
+ # Execute the map/reduce, returning the raw output.
+ # Useful when you don't care about map/reduce's ouptut.
+ #
+ # @example Run the map reduce
+ # map_reduce.execute
+ #
+ # @return [ Hash ] The raw output
+ #
+ # @since 3.1.0
+ alias :execute :raw
# Get the number of documents reduced by the map/reduce.
#
# @example Get the reduced document count.
# map_reduce.reduced