Permalink
Browse files

get/set -> (get|set)Parameter and a test SERVER-1843

  • Loading branch information...
1 parent 0553f2e commit 6d745c7834558a030ebcc9e3ea9fc604f744987d @erh erh committed Nov 23, 2010
Showing with 14 additions and 5 deletions.
  1. +5 −5 db/dbcommands_generic.cpp
  2. +9 −0 jstests/set_param1.js
View
@@ -68,19 +68,19 @@ namespace mongo {
class CmdGet : public Command {
public:
- CmdGet() : Command( "get" ) { }
+ CmdGet() : Command( "getParameter" ) { }
virtual bool slaveOk() const { return true; }
virtual bool adminOnly() const { return true; }
virtual LockType locktype() const { return NONE; }
virtual void help( stringstream &help ) const {
help << "get administrative option(s)\nexample:\n";
- help << "{ get:1, notablescan:1 }\n";
+ help << "{ getParameter:1, notablescan:1 }\n";
help << "supported so far:\n";
help << " quiet\n";
help << " notablescan\n";
help << " logLevel\n";
help << " syncdelay\n";
- help << "{ get:'*' } to get everything\n";
+ help << "{ getParameter:'*' } to get everything\n";
}
bool run(const string& dbname, BSONObj& cmdObj, string& errmsg, BSONObjBuilder& result, bool fromRepl ) {
bool all = cmdObj.firstElement().valuestrsafe();
@@ -111,13 +111,13 @@ namespace mongo {
class CmdSet : public Command {
public:
- CmdSet() : Command( "set" ) { }
+ CmdSet() : Command( "setParameter" ) { }
virtual bool slaveOk() const { return true; }
virtual bool adminOnly() const { return true; }
virtual LockType locktype() const { return NONE; }
virtual void help( stringstream &help ) const {
help << "set administrative option(s)\nexample:\n";
- help << "{ set:1, notablescan:true }\n";
+ help << "{ setParameter:1, notablescan:true }\n";
help << "supported so far:\n";
help << " notablescan\n";
help << " logLevel\n";
View
@@ -0,0 +1,9 @@
+
+old = db.adminCommand( { "getParameter" : "*" } )
+tmp1 = db.adminCommand( { "setParameter" : 1 , "logLevel" : 5 } )
+tmp2 = db.adminCommand( { "setParameter" : 1 , "logLevel" : old.logLevel } )
+now = db.adminCommand( { "getParameter" : "*" } )
+
+assert.eq( old , now , "A" )
+assert.eq( old.logLevel , tmp1.was , "B" )
+assert.eq( 5 , tmp2.was , "C" )

0 comments on commit 6d745c7

Please sign in to comment.