get rid of deprecation warning?
This commit is contained in:
@@ -1,9 +1,11 @@
|
|||||||
const { MongoClient } = require("mongodb");
|
const { MongoClient } = require("mongodb");
|
||||||
const PORT = process.env.MONGODB_PORT || 27017;
|
const PORT = process.env.MONGODB_PORT || 27017;
|
||||||
const HOST = process.env.MONGODB_HOST || 'localhost';
|
const HOST = process.env.MONGODB_HOST || "localhost";
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
const client = new MongoClient(`mongodb://${HOST}:${PORT}/dbName`);
|
const client = new MongoClient(`mongodb://${HOST}:${PORT}/dbName`, {
|
||||||
|
useUnifiedTopology: true
|
||||||
|
});
|
||||||
try {
|
try {
|
||||||
await client.connect();
|
await client.connect();
|
||||||
await client
|
await client
|
||||||
|
|||||||
Reference in New Issue
Block a user