Skip to content
This repository was archived by the owner on Dec 27, 2024. It is now read-only.

Commit bc99ecc

Browse files
committed
resolves #246
1 parent 1f0801f commit bc99ecc

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/core/sakura-mongo-db-connection.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
import {
2-
Db,
3-
MongoClient,
4-
MongoClientOptions
5-
} from 'mongodb';
1+
import { Db, MongoClient, MongoClientOptions } from 'mongodb';
62

73
const debug = {
84
normal: require('debug')('sapi:SakuraMongoDbConnection'),
@@ -41,6 +37,9 @@ export class SakuraMongoDbConnection {
4137
async connect(dbName: string, uri: string, options?: MongoClientOptions): Promise<Db> {
4238
debug.normal(`.connect dbName: '${dbName}', uri: '${uri}', options:`, options);
4339

40+
options = options || {};
41+
options.useNewUrlParser = true;
42+
4443
let db: Db;
4544

4645
db = this.getDb(dbName) || null;

0 commit comments

Comments
 (0)