Skip to content

Instantly share code, notes, and snippets.

@aheckmann
Created April 6, 2012 14:29
Show Gist options
  • Save aheckmann/2320351 to your computer and use it in GitHub Desktop.
Save aheckmann/2320351 to your computer and use it in GitHub Desktop.
using visionmedia/debug with mongoose
var mongoose = require('mongoose')
, debug = require('debug')('mongoose')
mongoose.set('debug', function (name, method) {
switch (method) {
case 'find':
case 'findOne':
case 'insert':
case 'update':
case 'remove':
// etc
debug(name + '.' + method + '(%j, %j)', arguments[2], arguments[3])
break;
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment