log all queries that mongoose fire in the application

You can enable debug mode like so:

mongoose.set('debug', true);

or add your own debug callback:

mongoose.set('debug', function (coll, method, query, doc [, options]) {
 //do your thing
});

This will log all executed collection methods and their arguments to the console.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)