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

Improve --quiet option in mongosh utility

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • No version
    • Affects Version/s: 1.8.0
    • Component/s: CLI Module
    • Labels:
      None
    • Environment:
      OS: Linux
      Additional info: mongosh 1.8.0
    • Not Needed

      Problem Statement/Rationale

      While using mongo utility with --quiet option, everything is fine to get data from mongodb server without unnecessary output. Using the mongosh I need extra work to  eliminate unnecessary characteres from the output.

       

      Please be sure to attach relevant logs with any sensitive data redacted.
      How to retrieve logs for: Compass; Shell

      //example with mongo utility

      echo "db.serverStatus().mem.resident" | mongo --port 27017 --quiet
      37212

      //example with mongosh utility

      echo "db.serverStatus().mem.resident" | mongosh --port 27017 --quiet
      PrdSet [direct: primary] test> db.serverStatus().mem.resident
      37212

      Steps to Reproduce

      echo "db.serverStatus().mem.resident" | mongosh --port 27017 --quiet

      Expected Results

      Just a number without any additional information about the server I am connecting to

      Actual Results

      PrdSet [direct: primary] test> db.serverStatus().mem.resident
      37212

      Additional Notes

      Expected results

      37212

            Assignee:
            Unassigned Unassigned
            Reporter:
            legatti@gmail.com Eduardo Legatti
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: