Skip to content

Instantly share code, notes, and snippets.

@jacksonfdam
Forked from aheckmann/mongoose debug
Created August 16, 2012 00:13
Show Gist options
  • Select an option

  • Save jacksonfdam/3364940 to your computer and use it in GitHub Desktop.

Select an option

Save jacksonfdam/3364940 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