mardi 27 septembre 2016

Using Rails 3.2.22 and Mongoid 2.5.1 with Mongo 3.2

I am attempting to upgrade our legacy rails/mongo application. Our production Mongodb is 2.4 and we would like to upgrade to 3.2 and still use Mongoid. We use auth on the development database as follows

mongo <host> -usome_user -psome_pwd --authenticationDatabase "some-database"

The Mongoid.yml file for Mongoid 2.5.1 doesn't seem to have the ability to pass the authentication database parameter, and the authentication fails when trying to perform a rake command, or even get into the rails console.

So my question is this, IS there a way to set the default authentication database so that this parameter does not need to be passed along? If not, then is there a way I can edit my 2.5.1 mongoid.yml so include this information? I am guessing the I will have to upgrade the whole nine yards to a version of Mongoid which can support Mongodb 3.2

Below is the pertinent part of the YML file: development: <<: *defaults hosts: - - - - port: database: username: password:<%= SOME_CREDENTIALS[:mongo][:password] %> max_retries_on_connection_failure: 1

Aucun commentaire:

Enregistrer un commentaire