Expose and document `printjson` as `printfull`, add `printejson`

XMLWordPrintableJSON

    • Type: New Feature
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Shell API
    • 2
    • None

      MONGOSH-955 highlighted that users have a need for using more complex value formatting needs than what print can deliver out of the box, and adding custom specifiers to console.dir() for example can quickly become unwieldy for human users.

      As a workaround, I suggest:

      • Rename printjson (which is kept as an alias) to printfull, for printing an object in its unabridged form. Document printfull as a public API.
      • Add printejson(value[, options]) as a shorthand for print(EJSON.stringify(value, null, options ?? 2)) in order to make it easier to get actual JSON output.

              Assignee:
              Unassigned
              Reporter:
              Anna Henningsen
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: