summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDwight <dmerriman@gmail.com>2009-02-11 09:34:00 -0500
committerDwight <dmerriman@gmail.com>2009-02-11 09:34:00 -0500
commit8154c0af5e2d528e25ea5b30ee3639362ff491a7 (patch)
tree43c53a66b396fbc97ac7ed9f446640d1377bf9b5
parent1515ab7f6bb227520e81f8eed88821af1fc9c2b4 (diff)
downloadmongo-8154c0af5e2d528e25ea5b30ee3639362ff491a7.tar.gz
db.shutdownServer() in shell
-rw-r--r--shell/db.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/shell/db.js b/shell/db.js
index 5ecb5174625..4fd0f456cc7 100644
--- a/shell/db.js
+++ b/shell/db.js
@@ -114,6 +114,12 @@ DB.prototype.dropDatabase = function() {
}
+DB.prototype.shutdownServer = function() {
+ if( "admin" != db )
+ return "shutdown command only works with the admin database; try 'use admin'";
+ return this._dbCommand("shutdown");
+}
+
/**
Clone database on another server to here.
<p>
@@ -189,6 +195,7 @@ DB.prototype.help = function() {
print("\tdb.setProfilingLevel(level) 0=off 1=slow 2=all");
print("\tdb.cloneDatabase(fromhost)");
print("\tdb.copyDatabase(fromdb, todb, fromhost)");
+ print("\tdb.shutdownServer()");
print("\tdb.dropDatabase()");
print("\tdb.repairDatabase()");
print("\tdb.eval(func, args) run code server-side");