Skip to content

Commit b811523

Browse files
committed
fix(database): use db() syntax rather than pulling dbName from client
1 parent fd077d1 commit b811523

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/agenda/database.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ module.exports = function(url, collection, options, cb) {
2727
collection = collection || 'agendaJobs';
2828
options = Object.assign({autoReconnect: true, reconnectTries: Number.MAX_SAFE_INTEGER, reconnectInterval: this._processEvery}, options);
2929
MongoClient.connect(url, options, (error, client) => {
30-
const database = client.s.options.dbName || 'agenda';
3130
if (error) {
3231
debug('error connecting to MongoDB using collection: [%s]', collection);
3332
if (cb) {
@@ -39,7 +38,7 @@ module.exports = function(url, collection, options, cb) {
3938
}
4039
debug('successful connection to MongoDB using collection: [%s]', collection);
4140
self._db = client;
42-
self._mdb = client.db(database);
41+
self._mdb = client.db();
4342
self.db_init(collection, cb);
4443
});
4544
return this;

0 commit comments

Comments
 (0)