I have connected to my database, with the help of the following code:
private connectDatabase(databaseUri: string): Promise<Mongoose.Connection> {
return Mongoose.connect(databaseUri).then(() => {
debug('Connected to MongoDB at %O', databaseUri);
return Mongoose.connection;
});
}
After that when I update my Mongoose to version 4.11.0, I got the following warning while running my tests:
(node:4138) DeprecationWarning: `open()` is deprecated in mongoose >= 4.11.0,
use `openUri()` instead, or set the `useMongoClient` option if using `connect()`
or `createConnection()`
Can you guide me on how to set the useMongoClient that is mentioned in the warning message?