Created
November 25, 2012 07:31
-
-
Save cj3kim/4142737 to your computer and use it in GitHub Desktop.
riak reduce function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function(values) { | |
var str = ""; | |
for(var val in values) { | |
if (val.constructor == Object) { | |
for (var key in val) { | |
str += val[key]; | |
} | |
} else { | |
str += val; | |
} | |
} | |
return [str]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
["hello", "hello", "hello", "hello", {"key"=>"value"}, {"boo"=>"tired"}, "hello", "this is a test", {"key"=>"value"}, {"key"=>"value"}, {"hello"=>"world"}, "", "hello", {"bar"=>"baz"}, "hello", {"very"=>"tired"}, "this is a test", {"key"=>"value"}, {"key"=>"value"}, "hello", "hello", {"person1"=>{"first_name"=>"Carol", "last_name"=>"Chan"}}, "key=value", {"hello"=>"world"}, {"key"=>"value"}, "hello", {"woof"=>"i love you"}, {"hello"=>"world"}, {"key"=>"value"}, "", "hello", "hello", {"key"=>"value"}, "this is a test", {"key"=>"value"}, "hello", "this is a test", {"hello"=>"world"}, {"hello"=>"world"}, {"key"=>"value"}, {"lol"=>"lol)\n"}, {"key"=>"value"}, "hello", "hello", "hello", {"key"=>"value"}, "hello", "hello", "hello", {"meow"=>"very awake"}, {"key"=>"value"}, {"hello"=>"awake"}, "hello", "hello", {"key"=>"value"}, "hello", "hello"]