summaryrefslogtreecommitdiff
path: root/src/mongo/db/dbcommands_generic.cpp
diff options
context:
space:
mode:
authorTad Marshall <tad@10gen.com>2012-10-16 15:18:19 -0400
committerTad Marshall <tad@10gen.com>2012-10-17 15:02:44 -0400
commit3e4f2ab253a717240c101478c022ac667db74cfd (patch)
tree9993fef12578a5a4128da992c1dd0b805fa64cdc /src/mongo/db/dbcommands_generic.cpp
parent8f5155b8b22c7aa23940d59d4640073ebffe8dab (diff)
downloadmongo-3e4f2ab253a717240c101478c022ac667db74cfd.tar.gz
SERVER-7344 add interpreterVersion to shell and buildInfo
Add the ability to get a string for the JavaScript engine so that scripts can know when they are running under SpiderMonkey versus V8. The shell gets an 'interpreterVersion()' function that returns a string. The 'buildInfo' command gets a new field named 'interpreterVersion'. SpiderMonkey returns "SpiderMonkey 1.7"; V8 returns "V8 3.12.19".
Diffstat (limited to 'src/mongo/db/dbcommands_generic.cpp')
-rw-r--r--src/mongo/db/dbcommands_generic.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/mongo/db/dbcommands_generic.cpp b/src/mongo/db/dbcommands_generic.cpp
index ec36f104758..25c9a0dde0c 100644
--- a/src/mongo/db/dbcommands_generic.cpp
+++ b/src/mongo/db/dbcommands_generic.cpp
@@ -110,10 +110,18 @@ namespace mongo {
help << "get version #, etc.\n";
help << "{ buildinfo:1 }";
}
- bool run(const string& dbname, BSONObj& jsobj, int, string& errmsg, BSONObjBuilder& result, bool fromRepl ) {
- result << "version" << versionString << "gitVersion" << gitVersion() << "sysInfo" << sysInfo();
- result << "versionArray" << versionArray;
- result << "bits" << ( sizeof( int* ) == 4 ? 32 : 64 );
+ bool run(const std::string& dbname,
+ BSONObj& jsobj,
+ int, // options
+ std::string& errmsg,
+ BSONObjBuilder& result,
+ bool fromRepl) {
+ result << "version" << versionString
+ << "gitVersion" << gitVersion()
+ << "sysInfo" << sysInfo()
+ << "versionArray" << versionArray
+ << "interpreterVersion" << globalScriptEngine->getInterpreterVersionString()
+ << "bits" << ( sizeof( int* ) == 4 ? 32 : 64 );
result.appendBool( "debug" , debug );
result.appendNumber("maxBsonObjectSize", BSONObjMaxUserSize);
return true;