Skip to content

Commit

Permalink
get rid of deprecation warning?
Browse files Browse the repository at this point in the history
  • Loading branch information
kaytwo committed Feb 11, 2020
1 parent a703cc5 commit e74bfef
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mongodb/client.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit e74bfef

Please sign in to comment.