db.listCommands has a bug

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Minor - P4
    • 3.0.0-rc6
    • Affects Version/s: 2.6.7
    • Component/s: Shell
    • None
    • Fully Compatible
    • ALL
    • 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,
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      > 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 );
          }
      }
      

              Assignee:
              Charlie Swanson
              Reporter:
              Chris Findlay
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: