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 authored and ljhaywar committed Nov 9, 2021
1 parent 4915872 commit ba2667e
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/mongo_client.ts
Original file line number Diff line number Diff line change
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 ba2667e

Please sign in to comment.