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.
- related to
-
MONGOSH-1352 Suppressed results from printJson in MongoSh
- Open
-
MONGOSH-955 printjson(...) will elide results if there are too many
- Closed