I used MongoClient.isConnected() method on version 3.6 of mongodb but now the method does not seem to exist anymore. Why?
If the expression MongoClient.isConnected()
is not clear I mean this:
const client = await MongoClient.connect(uri, options?);
client.isConnected(); // does not exist on type MongoClient
I am using Typescript, and of course I installed mongodb and its types (even if it is not necessary anymore with mongodb v.4.0).
How do I get to know if my database is connected or not?