-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
We are trying to use the Mongoid v3 driver in a cluster where the user we are connecting as only exists in the collection/database we are hitting, and not the system collection. We are using the following config to set up the Mongoid connection:
Mongoid.configure do |config|
config.sessions = {
:default => {
:hosts => ["#
"],
:database => "#
",
:username => "#
",
:password => "#
"
}
}
config.options = {
:skip_version_check => true
}
end
The mongo logs show the following:
Thu Nov 15 18:16:20 [initandlisten] connection accepted from x.x.x.x:46785 #656121
Thu Nov 15 18:16:20 [conn656121] authenticate:
Thu Nov 15 18:16:20 [conn656121] auth: couldn't find user hghhgh_user, system.system.users
Thu Nov 15 18:16:20 [conn656121] end connection x.x.x.x:46785
In my application log, I see an exception that notes:
'execution expired'
and references the moped driver.
I would like the Mongoid driver to NOT attempt to connect to the system collection at all.
Is there any reason it has to connect to the system collection?
Can I skip the system collection connect? Is there a way to change the config to enable me to connect to my collection, or is this a bug?
Can I initiate the database authentication explicitly like I could in the v2 driver?????
example:
Mongoid.database = Mongo::Connection.new(host,port).db(db)
Mongoid.database.authenticate(user,pass)
Chris