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

db.collection.getIndexes() output no longer pretty printed

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 0.14.0
    • Affects Version/s: None
    • Component/s: CLI Module
    • None
    • 2
    • Iteration Chicago
    • Needed
    • Hide

      There is a new `inspectCompact` config setting. It corresponds to the `compact` option in https://nodejs.org/api/util.html#util_util_inspect_object_options.

      Concretely, one can use config.set('inspectCompact', false); to make mongosh print every field of result objects/documents on its own line, instead of grouping multiple fields together.

      Show
      There is a new `inspectCompact` config setting. It corresponds to the `compact` option in https://nodejs.org/api/util.html#util_util_inspect_object_options . Concretely, one can use config.set('inspectCompact', false); to make mongosh print every field of result objects/documents on its own line, instead of grouping multiple fields together.

      Problem Description 

      The output from db.collection.getIndexes() is no longer pretty printed. (see screenshots)

      Steps to Reproduce

      Create an index on a collection 

      Run db.collection.getIndexes()

      Expected Results

      Pretty printed index information

      Actual Results

      Single line, compact index information

      Additional Notes

        1. Screen Shot 2021-04-09 at 1.57.11 PM.png
          Screen Shot 2021-04-09 at 1.57.11 PM.png
          10 kB
        2. Screen Shot 2021-04-09 at 1.56.42 PM.png
          Screen Shot 2021-04-09 at 1.56.42 PM.png
          16 kB
        3. mongo-shell.png
          mongo-shell.png
          46 kB
        4. mongosh.png
          mongosh.png
          39 kB

            Assignee:
            anna.henningsen@mongodb.com Anna Henningsen
            Reporter:
            dave.cuthbert@mongodb.com Dave Cuthbert (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: