[SERVER-16988] db.listCommands has a bug Created: 22/Jan/15  Updated: 23/Jan/15  Resolved: 22/Jan/15

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: 2.6.7
Fix Version/s: 3.0.0-rc6

Type: Bug Priority: Minor - P4
Reporter: Chris Findlay Assignee: Charlie Swanson
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

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

Participants:

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



 Comments   
Comment by Githook User [ 22/Jan/15 ]

Author:

{u'username': u'cswanson310', u'name': u'Charlie Swanson', u'email': u'cswanson310@gmail.com'}

Message: SERVER-16988 Fix typo in db.listCommands
Branch: master
https://github.com/mongodb/mongo/commit/d411d55cac9cb5dea88db7e9afe5c6fa4e831161

Comment by Ramon Fernandez Marina [ 22/Jan/15 ]

Thanks for your report chrisf@findly.com, looks like a cut & paste bug indeed.

Generated at Thu Feb 08 03:42:56 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.