summaryrefslogtreecommitdiff
path: root/src/mongo/client/dbclient_base.h
diff options
context:
space:
mode:
authorSara Golemon <sara.golemon@mongodb.com>2018-06-27 11:33:18 -0400
committerSara Golemon <sara.golemon@mongodb.com>2018-06-29 23:02:02 -0400
commit7d255086ddb335230b1373d5593e65cdc7ba45c3 (patch)
treed341ca4d62e080746ab8322f21e75e91e538cfd1 /src/mongo/client/dbclient_base.h
parent821f9f69916da51f97e001b1c45dff6e49533f81 (diff)
downloadmongo-7d255086ddb335230b1373d5593e65cdc7ba45c3.tar.gz
SERVER-35847 Remove eval command and remove/update related tests/helpers
Diffstat (limited to 'src/mongo/client/dbclient_base.h')
-rw-r--r--src/mongo/client/dbclient_base.h50
1 files changed, 0 insertions, 50 deletions
diff --git a/src/mongo/client/dbclient_base.h b/src/mongo/client/dbclient_base.h
index 4b09d7bae37..141f41f880d 100644
--- a/src/mongo/client/dbclient_base.h
+++ b/src/mongo/client/dbclient_base.h
@@ -449,27 +449,6 @@ public:
const std::string& fromhost = "",
BSONObj* info = 0);
- /** Run javascript code on the database server.
- dbname database SavedContext in which the code runs. The javascript variable 'db' will be
- assigned to this database when the function is invoked.
- jscode source code for a javascript function.
- info the command object which contains any information on the invocation result
- including the return value and other information. If an error occurs running the
- jscode, error information will be in info. (try "log() << info.toString()")
- retValue return value from the jscode function.
- args args to pass to the jscode function. when invoked, the 'args' variable will be
- defined for use by the jscode.
-
- returns true if runs ok.
-
- See testDbEval() in dbclient.cpp for an example of usage.
- */
- bool eval(const std::string& dbname,
- const std::string& jscode,
- BSONObj& info,
- BSONElement& retValue,
- BSONObj* args = 0);
-
/** validate a collection, checking for errors and reporting back statistics.
this operation is slow and blocking.
*/
@@ -479,35 +458,6 @@ public:
return runCommand(nsGetDB(ns).c_str(), cmd, info);
}
- /* The following helpers are simply more convenient forms of eval() for certain common cases */
-
- /* invocation with no return value of interest -- with or without one simple parameter */
- bool eval(const std::string& dbname, const std::string& jscode);
- template <class T>
- bool eval(const std::string& dbname, const std::string& jscode, T parm1) {
- BSONObj info;
- BSONElement retValue;
- BSONObjBuilder b;
- b.append("0", parm1);
- BSONObj args = b.done();
- return eval(dbname, jscode, info, retValue, &args);
- }
-
- /** eval invocation with one parm to server and one numeric field (either int or double)
- * returned */
- template <class T, class NumType>
- bool eval(const std::string& dbname, const std::string& jscode, T parm1, NumType& ret) {
- BSONObj info;
- BSONElement retValue;
- BSONObjBuilder b;
- b.append("0", parm1);
- BSONObj args = b.done();
- if (!eval(dbname, jscode, info, retValue, &args))
- return false;
- ret = (NumType)retValue.number();
- return true;
- }
-
/**
* { name : "<short collection name>",
* options : { }