debug

debug mongoose

add mongoose.set('debug', true);

src > mongoose.js
const mongoose = require('mongoose');

module.exports = function (app) {
  mongoose.connect(
    app.get('mongodb'),
    { useCreateIndex: true, useNewUrlParser: true }
  );
  mongoose.Promise = global.Promise;
  mongoose.set('debug', true); // ADD THIS
  app.set('mongooseClient', mongoose);
};

/*
or
  const isProduction = process.env.NODE_ENV === 'production';
  if(!isProduction){
    mongoose.set('debug', true);
  }
*/

debug feathers-mongoose-casl

run this command

$ cross-env DEBUG=feathers-mongoose-casl nodemon -prof src/

Last updated