We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
db()
1 parent 7aa3008 commit 51ea86dCopy full SHA for 51ea86d
src/mongo_client.ts
@@ -473,13 +473,6 @@ export class MongoClient extends TypedEventEmitter<MongoClientEvents> {
473
// Copy the options and add out internal override of the not shared flag
474
const finalOptions = Object.assign({}, this[kOptions], options);
475
476
- // If no topology throw an error message
477
- if (!this.topology) {
478
- throw new MongoDriverError(
479
- 'MongoClient must be connected before calling MongoClient.prototype.db'
480
- );
481
- }
482
-
483
// Return the db object
484
const db = new Db(this, dbName, finalOptions);
485
0 commit comments