diff options
author | Antonin Kral <a.kral@bobek.cz> | 2011-09-14 17:08:06 +0200 |
---|---|---|
committer | Antonin Kral <a.kral@bobek.cz> | 2011-09-14 17:08:06 +0200 |
commit | 5d342a758c6095b4d30aba0750b54f13b8916f51 (patch) | |
tree | 762e9aa84781f5e3b96db2c02d356c29cf0217c0 /shell/mongo.js | |
parent | cbe2d992e9cd1ea66af9fa91df006106775d3073 (diff) | |
download | mongodb-5d342a758c6095b4d30aba0750b54f13b8916f51.tar.gz |
Imported Upstream version 2.0.0
Diffstat (limited to 'shell/mongo.js')
-rw-r--r-- | shell/mongo.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/shell/mongo.js b/shell/mongo.js index e129784..2535769 100644 --- a/shell/mongo.js +++ b/shell/mongo.js @@ -24,8 +24,9 @@ if ( typeof mongoInject == "function" ){ mongoInject( Mongo.prototype ); } -Mongo.prototype.setSlaveOk = function() { - this.slaveOk = true; +Mongo.prototype.setSlaveOk = function( value ) { + if( value == undefined ) value = true + this.slaveOk = value } Mongo.prototype.getDB = function( name ){ @@ -43,6 +44,10 @@ Mongo.prototype.adminCommand = function( cmd ){ return this.getDB( "admin" ).runCommand( cmd ); } +Mongo.prototype.setLogLevel = function( logLevel ){ + return this.adminCommand({ setParameter : 1, logLevel : logLevel }) +} + Mongo.prototype.getDBNames = function(){ return this.getDBs().databases.map( function(z){ |