MapReduce var nameLength = function(value) { var doc = Riak.mapValues(value)[0]; return [doc.length]; }