We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3e9c86b commit 2248dfcCopy full SHA for 2248dfc
src/mongo_client.ts
@@ -513,10 +513,7 @@ export class MongoClient extends TypedEventEmitter<MongoClientEvents> {
513
try {
514
const skipPingOnConnect = this.s.options[Symbol.for('@@mdb.skipPingOnConnect')] === true;
515
if (!skipPingOnConnect && !options?.skipPing && topology.s.credentials != null) {
516
- await this.db().admin().ping({ readPreference }); // performs server selection and sends ping
517
- topology.stateTransition(STATE_CONNECTED);
518
- topology.emit(Topology.OPEN, topology);
519
- topology.emit(Topology.CONNECT, topology);
+ await this.db().admin().ping({ readPreference }); // goes through `executeOperation` so performs server selection
520
}
521
} catch (error) {
522
topology.close();
0 commit comments