mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
db.printShardingStatus
This commit is contained in:
parent
934525f8b1
commit
420a7e51f0
@ -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" ) );
|
||||
}
|
||||
|
@ -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";
|
||||
|
Loading…
Reference in New Issue
Block a user