Skip to content

Commit

Permalink
feat: add mongodb useUnifiedTopology config parameter (#4684)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruscon authored and pleerock committed Sep 5, 2019
1 parent 690e6f5 commit 92e4270
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
3 changes: 2 additions & 1 deletion ormconfig.circleci.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
"name": "mongodb",
"type": "mongodb",
"database": "test",
"useNewUrlParser": true
"useNewUrlParser": true,
"useUnifiedTopology": true
}
]
3 changes: 2 additions & 1 deletion ormconfig.json.dist
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
"type": "mongodb",
"database": "test",
"logging": false,
"useNewUrlParser": true
"useNewUrlParser": true,
"useUnifiedTopology": true
}
]
3 changes: 2 additions & 1 deletion ormconfig.travis.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"name": "mongodb",
"type": "mongodb",
"database": "test",
"useNewUrlParser": true
"useNewUrlParser": true,
"useUnifiedTopology": true
}
]
6 changes: 6 additions & 0 deletions src/driver/mongodb/MongoConnectionOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,4 +321,10 @@ export interface MongoConnectionOptions extends BaseConnectionOptions {
* Determines whether or not to use the new url parser. Default: false
*/
readonly useNewUrlParser?: boolean;

/**
* Determines whether or not to use the new Server Discovery and Monitoring engine. Default: false
* https://github.com/mongodb/node-mongodb-native/releases/tag/v3.2.1
*/
readonly useUnifiedTopology?: boolean;
}
3 changes: 2 additions & 1 deletion src/driver/mongodb/MongoDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@ export class MongoDriver implements Driver {
"auto_reconnect",
"minSize",
"monitorCommands",
"useNewUrlParser"
"useNewUrlParser",
"useUnifiedTopology"
];

// -------------------------------------------------------------------------
Expand Down

0 comments on commit 92e4270

Please sign in to comment.