const a =mongoose.connect('mongodb://localhost:3000/test',()=>{console.log("connected"),(e)=>{console.log("not")}})
//Result is connected
console.log(mongoose.connection.readyState);//result is 2
setTimeout(() => {
console.log(mongoose.connection.readyState);//result is 0
}, 60000)
I'm newbie in mongoose I was testing some code until a I fall with this code. I'm just wondering why the second output is 2 which means connecting and why the final output is 0 means disconnected.