cómo averiguar si la mangosta está conectada o no

// test.js
require('./app.js'); // which executes 'mongoose.connect()'

var mongoose = require('mongoose');
console.log(mongoose.connection.readyState);
Tired Tern