Skip to content

Instantly share code, notes, and snippets.

@SupermanScott
Created February 12, 2012 23:25
Show Gist options
  • Save SupermanScott/1811781 to your computer and use it in GitHub Desktop.
Save SupermanScott/1811781 to your computer and use it in GitHub Desktop.
reduce_function = bson.Code(
"function (key, values) {"
" var result = { tf: 0, df: 0};"
" values.forEach(function(value) {"
" result.tf += value.tf;"
" result.df = value.df;"
" });"
" return result;"
"}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment