You can use a configuration file to customize MongoDB Compass settings at startup. You cannot override any settings that have been set with a configuration file on the Compass interface.
Configuration File Location
- For macOS and Linux, the configuration file is located at
/etc/mongodb-compass.conf. - For Windows, the configuration file is located at
<path\to\compass>\..\mongodb-compass.cfg.
Syntax
You can configure Compass configuration file settings in either EJSON or YAML format.
EJSON
{
"setting": value,
"setting": value,
...
}YAML
setting option: value
setting option: value
...Settings
| Setting | Definition |
|---|---|
| autoUpdates | Allow Compass to periodically check for new updates. |
| enableGenAIFeatures | Allow Compass to use generative AI for natural language querying. This feature requires an Atlas login and a deployed Atlas cluster. |
| enableGenAISampleDocumentPassing | Allow MongoDB Compass to send sample field values with query and aggregation generation requests. These values can improve the results from the AI. If |
| enableDevTools | Enable Chrome DevTools in Compass. To learn more, see Toggle Chrome DevTools. |
| enableMaps | Allow Compass to make requests to third-party mapping services. |
| enableShell | Enable or disable the embedded MongoDB Shell on Compass. To learn more, see Disable the Embedded MongoDB Shell. |
| forceConnectionOptions | Assign connection option values for when you connect to your MongoDB deployment through Compass. These connection options cannot be overridden by connections from the Compass interface or a command line connection string. |
| ignoreAdditionalCommandLineFlags | Allow or disallow additional command-line option flags. |
| installURLHandlers | Register Compass as a handler for mongodb:// and mongodb+srv:// URLs. If Install Compass as URL Protocol Handler is enabled, you can open Compass by navigating to a mongodb:// or mongodb+srv:// URL in your internet browser. Available on macOS and Windows. |
| maxTimeMS | Specify an upper time limit for all Compass database operations. |
| networkTraffic | Prevent MongoDB Compass from performing outgoing network operations other than those to the database. |
| protectConnectionStrings | Sets all connection strings as read-only. Passwords in connection strings display as If |
| protectConnectionStringsForNewConnections | Sets connection strings for new connections as read-only by default. Passwords in new connection strings display as If |
| proxy | Enables you to specify or enforce the use of a proxy to connect to your deployment. For more information on connecting to your deployment with a proxy, see Proxy / SSH Tunnel Connection Tab. You must pass either a URL or the following format:
If you set |
| readOnly | Prevent users from performing write operations to your MongoDB deployment through Compass. To learn more, see Restrict Write Operations to MongoDB. |
| showKerberosPasswordField | Show or hide the Kerberos password field on the Compass connection form. To learn more, see Display the Kerberos Password Field. |
| theme | Specify the MongoDB Compass UI theme. The supported themes are DARK, LIGHT, and OS_THEME. |
| trackUsageStatistics | Allow Compass to send anonymous usage statistics. To learn more, see Configure Telemetry Options. |
Note
To view all available Compass configuration options, run the following command in the folder containing your MongoDB Compass executable:
<path-to-Compass-executable> --helpExample
To view a sample Compass configuration file, run the following command:
<path-to-Compass-executable> --show-example-config
If you do not already have a configuration file, run the following command to create a configuration file that uses the sample configuration settings:
<path-to-Compass-executable> --show-example-config > /etc/mongodb-compass.conf