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

db.listCommands has a bug

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 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,

      > 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@mongodb.com Charlie Swanson
            Reporter:
            chrisf@findly.com Chris Findlay
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: