From e74bfefe72db6dea83da533695baaa4703bed968 Mon Sep 17 00:00:00 2001 From: Chris Kanich Date: Mon, 10 Feb 2020 20:16:08 -0600 Subject: [PATCH] get rid of deprecation warning? --- mongodb/client.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mongodb/client.js b/mongodb/client.js index 6c28f5b..f82f9b9 100644 --- a/mongodb/client.js +++ b/mongodb/client.js @@ -1,9 +1,11 @@ const { MongoClient } = require("mongodb"); const PORT = process.env.MONGODB_PORT || 27017; -const HOST = process.env.MONGODB_HOST || 'localhost'; +const HOST = process.env.MONGODB_HOST || "localhost"; async function main() { - const client = new MongoClient(`mongodb://${HOST}:${PORT}/dbName`); + const client = new MongoClient(`mongodb://${HOST}:${PORT}/dbName`, { + useUnifiedTopology: true + }); try { await client.connect(); await client