development:
  sessions:
    default:
      uri: mongodb://localhost/router
      options:
        write:
          w: 1
        read: primary

        # Change the default consistency model to primary, secondary.
        # 'secondary' will send reads to secondaries, 'primary' sends everything
        # to master. (default: primary)
        # read: secondary_preferred

test:
  sessions:
    default:
      uri: mongodb://localhost/router_api_test
      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

production:
  sessions:
    default:
      uri: <%= ENV['MONGODB_URI'] %>
      options:
        write:
          w: 1
        read: primary

development:
  sessions:
    default:
      uri: <%= ENV["MONGODB_URI"] || "mongodb://localhost/router" %>
      options:
        write:
          w: 1
        read: primary

        # Change the default consistency model to primary, secondary.
        # 'secondary' will send reads to secondaries, 'primary' sends everything
        # to master. (default: primary)
        # read: secondary_preferred

test:
  sessions:
    default:
      uri: <%= ENV["TEST_MONGODB_URI"] || "mongodb://localhost/router_api_test" %>
      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

production:
  sessions:
    default:
      uri: <%= ENV["MONGODB_URI"] %>
      options:
        write:
          w: 1
        read: primary

Change default MongoDB uri to use ENV var
Change default MongoDB uri to use ENV var

Falls back to the defaults when ENV vars are not available. The TEST_*
prefix naming format is based on the TEST_DATABASE_URL one used in
Publishing API.
