Skip to content
Luke Bakken edited this page Oct 5, 2016 · 1 revision

Map Phase to Count Keys

Source File on GitHub

This function counts records in a given bucket with MapReduce. There are two phases to the map reduce. The below function provides the map phase and should be combined with Riak.reduceSum to provide the number of keys in the bucket.

function mapCount() {
  return [1]
}