summaryrefslogtreecommitdiff
path: root/src/mongo/shell/shell_utils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/shell/shell_utils.cpp')
-rw-r--r--src/mongo/shell/shell_utils.cpp14
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