Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-21745

Shell outputs diagnostic information in batch mode even with --quiet when talking to older mongod versions

    XMLWordPrintableJSON

Details

    • Fully Compatible
    • ALL
    • Hide

      Using a 3.2.0 shell against a 2.6 or 3.0 mongod, execute the following command:

      mongo --quiet localhost:27017/test -eval 'db.test.find();'
      

      ...note that a warning is displayed, despite the --quiet flag.

      Show
      Using a 3.2.0 shell against a 2.6 or 3.0 mongod, execute the following command: mongo --quiet localhost:27017/test -eval 'db.test.find();' ...note that a warning is displayed, despite the --quiet flag.
    • Query 2016-11-21

    Description

      When using the 3.2.0 RC4 shell to query against a 2.6 or 3.0 mongod/mongos, the shell always returns the following warning:

      $ mongo --quiet localhost:27017/test -eval 'db.test.find();'
      Cannot use 'commands' readMode, degrading to 'legacy' mode
      

      I would suggest that this error should be suppressed when running in batch mode using --quiet, as it will disrupt scripts that depend on generating output in a certain shape (e.g. XML or JSON). It's less important when running in interactive mode.

      mongos version mongod version Produces Warning
      3.2.0 RC4 2.6.11 Yes
      3.2.0 RC4 3.0.7 Yes
      3.2.0 RC4 3.2.0 RC4 No

      Attachments

        Activity

          People

            david.storch@mongodb.com David Storch
            stuart.hall@masternaut.com Stuart Hall
            Votes:
            7 Vote for this issue
            Watchers:
            14 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: