diff --git a/packages/strapi-hook-mongoose/lib/index.js b/packages/strapi-hook-mongoose/lib/index.js index e90eecd394..f5c83a0097 100644 --- a/packages/strapi-hook-mongoose/lib/index.js +++ b/packages/strapi-hook-mongoose/lib/index.js @@ -56,6 +56,7 @@ module.exports = function(strapi) { password, database, srv, + useUnifiedTopology } = connection.settings; const uriOptions = uri ? url.parse(uri, true).query : {}; @@ -85,6 +86,7 @@ module.exports = function(strapi) { connectOptions.useNewUrlParser = true; connectOptions.dbName = database; connectOptions.useCreateIndex = true; + connectOptions.useUnifiedTopology = useUnifiedTopology || 'false'; try { /* FIXME: for now, mongoose doesn't support srv auth except the way including user/pass in URI.