Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- getTen: (channel) ->
- mapFunc = () ->
- key = "#{this.ts.getFullYear()}-#{this.ts.getMonth()+1}-#{this.ts.getDate()}"
- values = { count: 1 }
- emit(key, values)
- reduceFunc = (key, values) ->
- return date: key, count: values.length
- Karma.collection.mapReduce mapFunc.toString(), reduceFunc.toString(), { out: {inline:1}, query: {ch:channel}, sort: {$natural:-1} }, (err, val) ->
- if err isnt null
- console.log('Error: ')
- console.log(err)
- else
- console.log('Success: ')
- console.log(val)
Add Comment
Please, Sign In to add comment