-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: CLI Module
-
None
-
3
-
Needed
-
-
Iteration Q, Iteration Utica
We want to add support for a global configuration file that mongosh reads, which is stored in a location that is not dependent on user configuration.
- mongosh reads this global configuration file, if it exists and is accessible, and use its values as defaults. The per-user configuration file always overrides these values.
- mongosh continues to only store configuration data in the per-user configuration file, and never writes to the global configuration file.
- In order to match the server's configuration file behavior:
On macOS, mongosh tries to read from /usr/local/etc/mongosh.conf, or /opt/homebrew/etc/mongosh.conf, and finally /etc/mongosh.conf in that order, and ignores the latter files if one of the former exists.
On Windows, mongosh tries to read from mongosh.cfg in the same directory as the mongosh.exe binary itself.
On all other platforms, mongosh reads from /etc/mongosh.conf.
The global config file supports YAML.