MongoDB URI should allow db with no username or password.

This commit is contained in:
Michael Glass 2011-08-29 16:13:21 -07:00 committed by Kyle Banker
parent 77e9c05e40
commit fd0e858021
1 changed files with 3 additions and 3 deletions

View File

@ -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]