Skip to content

Commit

Permalink
fix(db_ops): rename db to add user on
Browse files Browse the repository at this point in the history
Fixes NODE-1874
  • Loading branch information
kvwalker authored and mbroadst committed Mar 10, 2019
1 parent b4bc157 commit 79931af
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/operations/db_ops.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ function addUser(db, username, password, options, callback) {
const userPassword = md5.digest('hex');

// If we have another db set
const db = options.dbName ? new Db(options.dbName, db.s.topology, db.s.options) : db;
const dbToUse = options.dbName ? new Db(options.dbName, db.s.topology, db.s.options) : db;

// Fetch a user collection
const collection = db.collection(CONSTANTS.SYSTEM_USER_COLLECTION);
const collection = dbToUse.collection(CONSTANTS.SYSTEM_USER_COLLECTION);

// Check if we are inserting the first user
count(collection, {}, finalOptions, (err, count) => {
Expand Down

0 comments on commit 79931af

Please sign in to comment.