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

db.listCommands has a bug

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor - P4
    • Resolution: Fixed
    • 2.6.7
    • 3.0.0-rc6
    • 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,

    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

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

            Dates

              Created:
              Updated:
              Resolved: