Skip to content

remove deprecated useNewUrlParser and useUnifiedTopology #100

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions src/modules/mongodb.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import { Logger } from '@nodescript/logger';
import { config } from 'mesh-config';
import { dep } from 'mesh-ioc';
import { Db, MongoClient, MongoClientOptions } from 'mongodb';
import { Db, MongoClient } from 'mongodb';

import { getGlobalMetrics } from '../main/index.js';

interface MongoClientOptionsExtended extends MongoClientOptions {
useUnifiedTopology: boolean;
}

export class MongoDb {
client: MongoClient;

Expand All @@ -22,10 +18,8 @@ export class MongoDb {

constructor() {
this.client = new MongoClient(this.MONGO_URL, {
useNewUrlParser: true,
useUnifiedTopology: true,
ignoreUndefined: true,
} as MongoClientOptionsExtended);
});
}

get db(): Db {
Expand Down
Loading