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

View File

@ -130,9 +130,9 @@ module Mongo
if uname && pwd && db
auths << {'db_name' => db, 'username' => uname, 'password' => pwd}
elsif uname || pwd || db
raise MongoArgumentError, "MongoDB URI must include all three of username, password, " +
"and db if any one of these is specified."
elsif uname || pwd
raise MongoArgumentError, "MongoDB URI must include username, password, " +
"and db if username or password are specified."
end
@nodes << [host, port]