From 5d342a758c6095b4d30aba0750b54f13b8916f51 Mon Sep 17 00:00:00 2001 From: Antonin Kral Date: Wed, 14 Sep 2011 17:08:06 +0200 Subject: Imported Upstream version 2.0.0 --- shell/mongo.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'shell/mongo.js') 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){ -- cgit v1.2.3