development:
  sessions:
    default:
      database: content_store_development
      hosts:
        - localhost:27017
      options:
        write:
          w: 1
        read: primary
test:
  sessions:
    default:
      database: content_store_test
      hosts:
        - localhost:27017
      options:
        write:
          w: 1
        read: primary
        # In the test environment we lower the retries and retry interval to
        # low amounts for fast failures.
        max_retries: 1
        retry_interval: 0

development:
  sessions:
    default:
      database: <%= ENV['MONGO_DB_NAME'] || 'content_store_development' %>
      hosts:
        - localhost:27017
      options:
        write:
          w: 1
        read: primary
test:
  sessions:
    default:
      database: content_store_test
      hosts:
        - localhost:27017
      options:
        write:
          w: 1
        read: primary
        # In the test environment we lower the retries and retry interval to
        # low amounts for fast failures.
        max_retries: 1
        retry_interval: 0

Allow mongo db name to be set from ENV
Allow mongo db name to be set from ENV

https://trello.com/c/9IjHVbeJ

to be able to run two instances of content-store in development,
one as live and other as draft, we need to be able to switch to
the respective database.

intention is to set MONGO_DB_NAME envvar with value as
draft_content_store_development through govuk_setenv
when running the draft-content-store instance.

mongoid ERB parses mongoid.yml allowing us to use ERB interpolation:

https://github.com/mongoid/mongoid/blob/master/lib/mongoid/config/environment.rb#L40
