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

Create API for global shell settings

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 0.12.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • 3
    • Iteration Z, Iteration Athens
    • Needed
    • Hide

      mongosh introduces a new API:

      • config – Prints the current values of shell configuration setting
      • config.get(key) – Returns the current value of a shell configuration setting
      • config.set(key, value) – Changes the current value of a shell configuration setting

      Initially supported settings are:

      • batchSize – The number of items displayed per cursor iteration
      • enableTelemetry – Whether telemetry data is enabled (this is also modifiable through enableTelemetry() and disableTelemetry() calls)
      • inspectDepth – The depth up to which objects are printed (this can be set to Infinity in order to print all objects to their full depth)
      • historyLength – The number of items to store in the REPL’s history file.

      E.g. config.set('batchSize', 100) can be used to make the shell print 100 items returned from db.coll.find() in one chunk.

      Configuration values are persisted between sessions.

      This only affects the mongosh CLI and not the embedded version in Compass.

      Show
      mongosh introduces a new API: config – Prints the current values of shell configuration setting config.get(key) – Returns the current value of a shell configuration setting config.set(key, value) – Changes the current value of a shell configuration setting Initially supported settings are: batchSize – The number of items displayed per cursor iteration enableTelemetry – Whether telemetry data is enabled (this is also modifiable through enableTelemetry() and disableTelemetry() calls) inspectDepth – The depth up to which objects are printed (this can be set to Infinity in order to print all objects to their full depth) historyLength – The number of items to store in the REPL’s history file. E.g. config.set('batchSize', 100) can be used to make the shell print 100 items returned from db.coll.find() in one chunk. Configuration values are persisted between sessions. This only affects the mongosh CLI and not the embedded version in Compass.

      Use cases we mentioned so far:

      • enable/disable stack traces
      • set printing "batch" size (old DBQuery thing)
      • set actual batch size
      • inspect depth
      • history length

      Settings are stored in the JSON file and preserved across sessions.

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

              Created:
              Updated:
              Resolved: