Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-5070

Documentation is incorrect

    • Type: Icon: Bug Bug
    • Resolution: Gone away
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Docs
    • Labels:
      None

      Working on an open source project (omniauth-identity), trying to setup specs (in Ruby / RSpec) that utilize MongoDB. The documentation for Mongoid is incorrect.

      The documentation claims:

      The simplest configuration is as follows, which configures Mongoid to talk to a MongoDB server at "localhost:27017" and use the database named "mongoid".

      This is a lie, as that "simplest" configuration is not valid as shown:

      development:
        clients:
          default:
            database: mongoid
            hosts:
              - localhost:27017
      

      To wit, when I attempt to use that config (slightly modified as I am in the "test" environment):

      test:
        clients:
          default:
            database: mongoid_test
            hosts:
              - localhost:27017
      

      I get the following error:

           Mongoid::Errors::NoClientConfig:       message:
               No configuration could be found for a client named 'secondary'.
             summary:
               When attempting to create the new client, Mongoid could not find a client configuration for the name: 'secondary'. This is necessary in order to know the host, port, and options needed to connect.
             resolution:
               Double check your mongoid.yml to make sure under the clients key that a configuration exists for 'secondary'. If you have set the configuration programatically, ensure that 'secondary' exists in the configuration hash.
      

      To which I have to say... if "secondary" is required... please document how it should look!

       

       

            Assignee:
            andreas.braun@mongodb.com Andreas Braun
            Reporter:
            peter.boling@gmail.com Peter Boling
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: