Skip to content

Commit

Permalink
fix(NODE-3417): allow calling db() before MongoClient is connected (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Jul 16, 2021
1 parent 7aa3008 commit 51ea86d
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/mongo_client.ts
Expand Up @@ -473,13 +473,6 @@ export class MongoClient extends TypedEventEmitter<MongoClientEvents> {
// Copy the options and add out internal override of the not shared flag
const finalOptions = Object.assign({}, this[kOptions], options);

// If no topology throw an error message
if (!this.topology) {
throw new MongoDriverError(
'MongoClient must be connected before calling MongoClient.prototype.db'
);
}

// Return the db object
const db = new Db(this, dbName, finalOptions);

Expand Down

0 comments on commit 51ea86d

Please sign in to comment.