Uploaded image for project: 'MongoDB Shell'
  1. MongoDB Shell
  2. MONGOSH-1063

Add support for a global configuration file

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.2.1
    • Affects Version/s: None
    • Component/s: CLI Module
    • Labels:
      None
    • 3
    • Needed
    • Hide

      mongosh now supports a global configuration file. The global configuration file is read from an OS-dependent location (see engineering description). There is no default configuration file included in the packages. The global configuration file uses YAML, with all options currently namespaced under mongosh. The set of options is the same as currently supported by the per-user configuration file.

      For example, the file contents could be:

      mongosh:
        inspectDepth: 20
      
      Show
      mongosh now supports a global configuration file. The global configuration file is read from an OS-dependent location (see engineering description). There is no default configuration file included in the packages. The global configuration file uses YAML, with all options currently namespaced under mongosh . The set of options is the same as currently supported by the per-user configuration file. For example, the file contents could be: mongosh: inspectDepth: 20
    • 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.

            Assignee:
            anna.henningsen@mongodb.com Anna Henningsen
            Reporter:
            anna.henningsen@mongodb.com Anna Henningsen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: