Skip to content

Instantly share code, notes, and snippets.

@SupermanScott
Created February 12, 2012 23:22
Show Gist options
  • Save SupermanScott/1811728 to your computer and use it in GitHub Desktop.
Save SupermanScott/1811728 to your computer and use it in GitHub Desktop.
map_function = bson.Code(
"function () {"
" for (var i=0; i < this.matches.length; i++) {"
" var match = this.matches[i];"
" var data = {tf: match.term_fq, df: this.document_fq};"
" emit(this.matches[i].doc_id, data);"
" }}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment