get rid of deprecation warning?

This commit is contained in:
Chris Kanich
2020-02-10 20:16:08 -06:00
parent a703cc5965
commit e74bfefe72

View File

@@ -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