Thank you @Guillermo_Lo_Coco. 
I’ve found this 2 links related to the removal of the client.isConnected()
and how it now works. From what I could understand, the connection/reconnection is now practically managed internally for every operation, so there is no need to try to reconnect manually.
clicking on the “list here” text points to a link about the Unified Topology Design that explains the reasoning behind the removal of many 3.x commands. Here is the relevant section in my opinion:
I was using code like this for reusing connection from AWS Lambda, as recommended from MongoDB doc called “Best Practices Connecting From AWS Lambda” (http:// docs . atlas . mongodb . com/best-practices-connecting-from-aws-lambda/ sorry, I can’t post more than 2 links per post so…
):
let cachedDb: Db;
let client: MongoClient;
export const connectToDatabase = async () => {
if (cachedDb && client?.isConnected()) {
console.log("Existing cached connection found!");
return cachedDb;
}
console.log("Aquiring new DB connection....");
try {
// Connect to our MongoDB database hosted on MongoDB Atlas
client = await MongoClient.connect(MONGODB_URI, {
useNewUrlParser: true,
useUnifiedTopology: true,
});
// Specify which database we want to use
const db = await client.db(DB_NAME);
cachedDb = db;
return db;
} catch (error) {
console.log("ERROR aquiring DB Connection!");
console.log(error);
throw error;
}
};
But after reading the referenced links I changed it to something like this:
let cachedDb: Db;
let client: MongoClient;
export const connectToDatabase = async () => {
if (cachedDb) {
console.log("Existing cached connection found!");
return cachedDb;
}
console.log("Aquiring new DB connection....");
try {
// Connect to our MongoDB database hosted on MongoDB Atlas
client = await MongoClient.connect(MONGODB_URI);
// Specify which database we want to use
const db = await client.db(DB_NAME);
cachedDb = db;
return db;
} catch (error) {
console.log("ERROR aquiring DB Connection!");
console.log(error);
throw error;
}
};
Hope it helps anyone trying to know about alternatives or why the commands were removed.