Skip to content

Commit

Permalink
Cradle's view.map takes a function, not a string
Browse files Browse the repository at this point in the history
  • Loading branch information
joeybaker committed Aug 27, 2013
1 parent 525649c commit ab76b80
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/winston-couchdb.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,12 @@ Couchdb.prototype._ensureView = function (callback) {
self.client.save('_design/Logs', {
views: {
byTimestamp: {
map: '(' + function (doc) {
map: function (doc) {
if (doc.resource === 'log') {
/* global emit */
emit(doc.params.timestamp, doc);
}
} + ')'
}
}
}
}, callback);
Expand Down

0 comments on commit ab76b80

Please sign in to comment.