_connect() { if (!this._connectionPromise) { this._connectionPromise = MongoClient.connect( this._databaseURI, this._mongoOptions ).then((client) => { this._client = client; return client.db(client.s.options.dbName); }); } return this._connectionPromise; }
_connect() { if (!this._connectionPromise) { this._connectionPromise = _mongodb.MongoClient.connect(this._databaseURI, this._mongoOptions).then(client => { this._client = client; return client.db(client.s.options.dbName); }); } return this._connectionPromise; }
const options = client.s.options; const database = client.db(options.dbName);
const options = client.s.options; const database = client.db(options.dbName); if (!database) {
_connect() { if (!this._connectionPromise) { this._connectionPromise = _mongodb.MongoClient.connect(this._databaseURI, this._mongoOptions).then(client => { this._client = client; return client.db(client.s.options.dbName); }); } return this._connectionPromise; }
_connect() { if (!this._connectionPromise) { this._connectionPromise = MongoClient.connect( this._databaseURI, this._mongoOptions ).then(client => { this._client = client; return client.db(client.s.options.dbName); }); } return this._connectionPromise; }