# File lib/mongoid/contexts/enumerable.rb, line 21 def aggregate {}.tap do |counts| group.each_pair { |key, value| counts[key] = value.size } end end