MongoDB in the properties.json
  • Dark
    Light
  • PDF

MongoDB in the properties.json

  • Dark
    Light
  • PDF

MongoDB Properties

The MongoDB properties must be configured to connect to a single MongoDB server or a MongoDB replica set. Be sure to align your authentication and encryption settings with the configurations of the MongoDB you are connecting to.

Property Name Type Default Description
db String pronghorn The name of the database to connect to.
url String mongodb://localhost:27017 The MongoDB URL to use when connecting to the database.
maxPoolSize Integer 100 A number that represents the maximum number of connections allowed within a connection pool. Valid values range from 1 to 65535.
credentials.dbAuth Boolean false A boolean flag indicating whether user authentication is enabled.
credentials.dbAuthSource String The user provided db property value. Specify the database name associated with the user’s credentials. Corresponds to authSource in MongoDB connection options.
credentials.user String The username to use for connections when authentication is enabled.
credentials.passwd String The password to use for connections when authentication is enabled.
ssl.enabled Boolean false A boolean flag indicating whether SSL is enabled.
ssl.sslValidate Boolean false A boolean flag indicating whether the MongoDB server's certificate will be validated.
ssl.sslCA String Path to the certificate authority PEM (privacy enhanced mail) file that signed the MongoDB certificates.
ssl.acceptInvalidCerts Boolean A boolean flag indicating whether to validate the MongoDB certificate against the certificate authority PEM file.
ssl.checkServerIdentity Boolean A boolean flag indicating whether to validate the name of the server configured in the URL against the common name of the certificate the server presents.
replSet.enabled Boolean false A boolean flag indicating whether we are connecting to a replica set. When connecting to a replica set, the names of the servers and the replica set name must be configured as part of the URL.

Minimal MongoDB Configuration

"mongoProps": {
  "db": "pronghorn",
  "url": "mongodb://localhost:27017"
}

Sample Production Configuration

"mongoProps": {
  "db": "pronghorn",
  "url": "mongodb://mongo01:27017,mongo02:27017,mongo03:27017?rs=rs1",
  "credentials": {
    "dbAuth": true,
    "user": "pronghorn",
    "passwd": "$ENC93f88824437dfe5784c7570f99d7251f878a2284aed6449259"
  },
  "ssl": {
    "enabled": true,
    "sslValidate": true,
    "sslCA": "/etc/ssl/keys/mongo_ca_chain.cert",
    "acceptInvalidCerts": false,
    "checkServerIdentity": true
  },
  "replSet": {
    "enabled": true
  }
}
Note:

Refer to the MongoDB guide for more detail on installing MongoDB with IAP.

Connection Pool Size in MongoDB

Connection pooling allows you to reuse connections rather than creating a new one every time IAP needs to establish a connection to the Mongo database. To configure the connection pool when connecting to MongoDB, use the maxPoolSize setting under mongoProps within the properties.json file.

This setting limits the ability of each application or adapter to add connections to the connection pool. In other words, it regulates (limits) the maximum number of pooled connections that can be opened for every application and adapter. When the maximum number of connections is reached, no additional connections can be created (opened) in the connection pool. Modification of maxPoolSize should be done with careful testing, as any changes to this value can impact IAP and workflow performance.

⚠ Warning

We recommend the default value for this setting as very low values can significantly affect platform performance. Please exercise caution if you elect to lower the default value. If degradation is observed, restore it to the default.

Property Name Type Default Description
maxPoolSize Integer 10 A number that represents the maximum number of connections allowed within a connection pool. Valid values range from 1 to 65535.

Sample Connection Pool Configuration

"mongoProps": {
  "db": "pronghorn",
  "url": "mongodb://localhost:27017",
  "maxPoolSize": 10
}

For more information on connection pooling, refer to:


Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.