Skip to content
This repository has been archived by the owner on Nov 6, 2019. It is now read-only.

How to provide DB Credentials and Options while initialising #88

Open
sincerekamal opened this issue Sep 3, 2018 · 0 comments
Open

Comments

@sincerekamal
Copy link

sincerekamal commented Sep 3, 2018

How can i provide DB credentials(username and password) and other options(replSet, strategy, poolSize, etc.,) while initialising the connection ?

For example, below is my db.options

config.db.options = {
    db: {
      native_parser: true
    },
    server: {
      poolSize: 5
    },
    replset: {
      rs_name: "MainRepSet",
      connectWithNoPrimary: true,
      auto_reconnect: true,
      socketOptions: {
        keepAlive: 1,
        connectTimeoutMS: 5000
      },
      strategy: "ping",
      read_secondary: true,
      readPreference: "nearest",
      slaveOk: true,
      safe: {
        w: "majority",
        j: 1,
        wtimeout: 10000
      }
    },
    user: process.env.DB_USERNAME,
    pass: process.env.DB_PASS
  }

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant