development:
  sessions:
    default:
      database: govuk_assets_development
      hosts:
        - localhost:27017
      options:
        write:
          w: 1
        read: primary
test:
  sessions:
    default:
      database: govuk_assets_test
      hosts:
        - localhost:27017
      options:
        write:
          w: 1
        read: primary
        max_retries: 1
        retry_interval: 0

# set these environment variables on your prod server
production:
  sessions:
    default:
      database: <%= ENV['MONGOID_DATABASE'] %>
      hosts:
        - "<%= ENV['MONGOID_HOST'] %>:<%= ENV['MONGOID_PORT'] %>"
      username: <%= ENV['MONGOID_USERNAME'] %>
      password: <%= ENV['MONGOID_PASSWORD'] %>
      options:
        write:
          w: 1
        read: primary
        # max_retries: 30
        # retry_interval: 1

development:
  sessions:
    default:
      uri: mongodb://localhost/govuk_assets_development
      options:
        write:
          w: 1
        read: primary
test:
  sessions:
    default:
      uri: mongodb://localhost/govuk_assets_test
      options:
        write:
          w: 1
        read: primary
        max_retries: 1
        retry_interval: 0
production:
  sessions:
    default:
      uri: <%= ENV['MONGODB_URI'] %>
      options:
        write:
          w: 1
        read: primary
        retry_interval: 120

Use environment variables for secret MongoDB config
Use environment variables for secret MongoDB config

~~12 Factor style~~

This also moves the `retry_interval` out of the `alphagov-deployment`
version of `mongoid.yml`, as it's not a secret, and now we're using
ENV vars for connection details, we don't need a separate/secret
production version of the config.

Convert `development`/`test` to use `uri` based config for consistency
and drop the port, as this doesn't seem to be need - i assume mongo
defaults to that port.
