Configure Settings
On this page
To specify certain shell behaviors, you can configure mongosh
settings.
Configurable Settings
You can configure the following settings for mongosh
:
Key | Type | Default | Description |
---|---|---|---|
| boolean |
| Specifies whether MongoDB Shell writes log entries. |
| integer | 20 | The number of items displayed per cursor iteration |
| boolean |
| Enables sending anonymized tracking and diagnostic data to MongoDB. |
| string |
| Designates an editor to use within the |
| boolean |
| Only available in the global configuration file. When true, users cannot enable telemetry manually. |
| integer | 1000 | The number of items to store in |
| integer or boolean | 3 | |
| integer or Infinity | 6 | The depth to which objects are printed. Setting |
| boolean | false | Specifies whether MongoDB Shell compresses log files. When this
value is |
| string | Depends on your operating system. See View Shell Logs. | Directory where MongoDB Shell writes log files. Specify an absolute filepath. See Specify Log File Location. |
| integer or Infinity | 100 | Maximum number of log files that the MongoDB Shell retains. After the MongoDB Shell reaches the maximum log file count, it starts deleting the oldest log files until the count is below the threshold. See Modify Maximum Log File Count. |
| integer or Infinity | 30 | Number of days that MongoDB Shell log files are retained. If this
value is set to |
| float or Infinity | Unset | Maximum amount of space in gigabytes used for MongoDB Shell logs. If the combined size of MongoDB Shell logs exceeds this value, log files are deleted starting with the oldest logs. If this value is set to |
| string |
| Controls what information is recorded in the shell history. Must be one of:
|
| boolean |
| Controls display of a stack trace along with error messages. |
| boolean |
| If |
| string | A semicolon-separated list of URLs that link to a snippet registry. | |
| string |
How to Configure Settings
To configure mongosh
settings, you can either use: