Use the MongoDB setting useUnifiedTopology when testing connection (#9561)

Signed-off-by: Derrick Mehaffy <derrickmehaffy@gmail.com>
This commit is contained in:
DMehaffy 2021-03-02 00:56:41 -07:00 committed by GitHub
parent 65bc2d04d3
commit 154e59c9c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,6 +23,7 @@ module.exports = async ({ connection }) => {
connectOptions.ssl = ssl ? true : false;
connectOptions.useNewUrlParser = true;
connectOptions.dbName = connection.settings.database;
connectOptions.useUnifiedTopology = true;
return Mongoose.connect(
`mongodb${srv ? '+srv' : ''}://${connection.settings.host}${