diff options
| author | Antonin Kral <a.kral@bobek.cz> | 2013-07-17 16:21:49 +0200 |
|---|---|---|
| committer | Antonin Kral <a.kral@bobek.cz> | 2013-07-17 16:21:49 +0200 |
| commit | e3904bf97e74cbbe5dde6b3abc3e797ad7d26b5d (patch) | |
| tree | f2d76fa86bfce0e897a616e02551bdd7d9913682 /src/mongo/shell/shell_utils.cpp | |
| parent | bef4346b845150d5318fd7a0acb43554f0d40a06 (diff) | |
Imported Upstream version 2.4.5upstream/2.4.5
Diffstat (limited to 'src/mongo/shell/shell_utils.cpp')
| -rw-r--r-- | src/mongo/shell/shell_utils.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/mongo/shell/shell_utils.cpp b/src/mongo/shell/shell_utils.cpp index dce193c1a44..9c48487d314 100644 --- a/src/mongo/shell/shell_utils.cpp +++ b/src/mongo/shell/shell_utils.cpp @@ -18,11 +18,13 @@ #include "pch.h" #include "mongo/shell/shell_utils.h" + +#include "mongo/client/dbclientinterface.h" +#include "mongo/scripting/engine.h" #include "mongo/shell/shell_utils_extended.h" #include "mongo/shell/shell_utils_launcher.h" #include "mongo/util/processinfo.h" -#include "mongo/client/dbclientinterface.h" -#include "mongo/scripting/engine.h" +#include "mongo/util/version.h" namespace mongo { @@ -124,6 +126,13 @@ namespace mongo { #endif } + BSONObj getBuildInfo(const BSONObj& a, void* data) { + uassert( 16822, "getBuildInfo accepts no arguments", a.nFields() == 0 ); + BSONObjBuilder b; + appendBuildInfo(b); + return BSON( "" << b.done() ); + } + BSONObj interpreterVersion(const BSONObj& a, void* data) { uassert( 16453, "interpreterVersion accepts no arguments", a.nFields() == 0 ); return BSON( "" << globalScriptEngine->getInterpreterVersionString() ); @@ -136,6 +145,7 @@ namespace mongo { scope.injectNative( "_rand" , JSRand ); scope.injectNative( "_isWindows" , isWindows ); scope.injectNative( "interpreterVersion", interpreterVersion ); + scope.injectNative( "getBuildInfo", getBuildInfo ); #ifndef MONGO_SAFE_SHELL //can't launch programs |
