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

db.listCommands has a bug

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: 2.6.7
    • Fix Version/s: 3.0.0-rc6
    • Component/s: Shell
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide

      Connect to mongo using the mongo commandline client.
      In my case, the latest release of the enterprise verson,

      Show
      Connect to mongo using the mongo commandline client. In my case, the latest release of the enterprise verson,

      Description

      > version()
      2.6.7
      dev-be-mongo-01(mongod-2.4.12)[PRIMARY] admin:
      > db.listCommands
      function (){
          var x = this.runCommand( "listCommands" );
          for ( var name in x.commands ){
              var c = x.commands[name];
       
              var s = name + ": ";
       
              if (c.adminOnly) s += " adminOnly ";
              if (c.adminOnly) s += " slaveOk ";        // BUG here: should be checking c.slaveOk instead!
       
              s += "\n  ";
              s += c.help.replace(/\n/g, '\n  ');
              s += "\n";
       
              print( s );
          }
      }

        Attachments

          Activity

            People

            Assignee:
            charlie.swanson Charlie Swanson
            Reporter:
            chrisf@findly.com Chris Findlay
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: