MongoDB URI should allow db with no username or password.
This commit is contained in:
parent
77e9c05e40
commit
fd0e858021
|
@ -130,9 +130,9 @@ module Mongo
|
||||||
|
|
||||||
if uname && pwd && db
|
if uname && pwd && db
|
||||||
auths << {'db_name' => db, 'username' => uname, 'password' => pwd}
|
auths << {'db_name' => db, 'username' => uname, 'password' => pwd}
|
||||||
elsif uname || pwd || db
|
elsif uname || pwd
|
||||||
raise MongoArgumentError, "MongoDB URI must include all three of username, password, " +
|
raise MongoArgumentError, "MongoDB URI must include username, password, " +
|
||||||
"and db if any one of these is specified."
|
"and db if username or password are specified."
|
||||||
end
|
end
|
||||||
|
|
||||||
@nodes << [host, port]
|
@nodes << [host, port]
|
||||||
|
|
Loading…
Reference in New Issue