Skip to content

Commit 79931af

Browse files
kvwalkermbroadst
authored andcommitted
fix(db_ops): rename db to add user on
Fixes NODE-1874
1 parent b4bc157 commit 79931af

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/operations/db_ops.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,10 @@ function addUser(db, username, password, options, callback) {
9797
const userPassword = md5.digest('hex');
9898

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

102102
// Fetch a user collection
103-
const collection = db.collection(CONSTANTS.SYSTEM_USER_COLLECTION);
103+
const collection = dbToUse.collection(CONSTANTS.SYSTEM_USER_COLLECTION);
104104

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

0 commit comments

Comments
 (0)