Class: Mongoid::Criteria

Inherits:
Object
  • Object
show all
Defined in:
lib/reductor.rb

Instance Method Summary collapse

Instance Method Details

#reduction(reduction_type, out: :inline, options: {}) ⇒ Object



4
5
6
7
# File 'lib/reductor.rb', line 4

def reduction(reduction_type, out: :inline, options: {})
  reductor = Reductor.new(self, reduction_type, options)
  Hash[reductor.reduce.out(inline: true).map{|e| [e['_id'], e["value"]] }]
end