0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

db.printShardingStatus

This commit is contained in:
Eliot Horowitz 2009-11-19 10:07:59 -05:00
parent 934525f8b1
commit 420a7e51f0
2 changed files with 12 additions and 0 deletions

View File

@ -261,6 +261,7 @@ DB.prototype.help = function() {
print("\tdb.printCollectionStats()" );
print("\tdb.printReplicationInfo()");
print("\tdb.printSlaveReplicationInfo()");
print("\tdb.printShardingStatus()");
print("\tdb.removeUser(username)");
print("\tdb.repairDatabase()");
print("\tdb.resetError()");
@ -620,3 +621,7 @@ DB.prototype.serverStatus = function(){
DB.prototype.version = function(){
return this.serverBuildInfo().version;
}
DB.prototype.printShardingStatus = function(){
printShardingStatus( this.getSisterDB( "config" ) );
}

View File

@ -204,6 +204,13 @@ ShardingTest.prototype.printShardingStatus = function(){
}
printShardingStatus = function( configDB ){
var version = configDB.getCollection( "version" ).findOne();
if ( version == null ){
print( "not a shard db!" );
return;
}
var raw = "";
var output = function(s){
raw += s + "\n";