mongo.isConnected alternative for node driver v4+

Viewed 133

Is there any alternative for the deprecated MongoClient.isConnected in the native Node JS MongoDB driver?

I read somewhere that one can handle the check via callbacks, which one can pass as parameters in the .connect Method (See the docs.) However, I wasn't able to successfully do that.

1 Answers
Related