Skip to content

Instantly share code, notes, and snippets.

@colwilson
Created October 19, 2011 13:10
Show Gist options
  • Save colwilson/1298237 to your computer and use it in GitHub Desktop.
Save colwilson/1298237 to your computer and use it in GitHub Desktop.
# define the map function
# this function will be called for every basket and
# is used to emit whatever information that we want
# about the contents each basket, although the data
# must be in the format (key, value) although
# value can be an object if nescessary
mapFunc = ->
key = @fruit
values = {
count: @count,
baskets: 1
}
emit(key, values)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment