Module: RiakRecord

Defined in:
lib/riak_record.rb,
lib/riak_record/base.rb,
lib/riak_record/callbacks.rb,
lib/riak_record/associations.rb,
lib/riak_record/finder/basic.rb,
lib/riak_record/finder/erlang_enhanced.rb

Defined Under Namespace

Modules: Associations, Callbacks, Finder Classes: Base

Instance Method Summary collapse

Instance Method Details

#count_map_reduceObject



31
32
33
34
35
36
# File 'lib/riak_record/finder/erlang_enhanced.rb', line 31

def count_map_reduce
  Riak::MapReduce.new(@finder_class.client).
    index(@bucket, @index, @value).
    map(['riak_record_kv_mapreduce', 'map_count_found'], :keep => false).
    reduce(['riak_kv_mapreduce','reduce_sum'], :keep => true).run.first
end