diff options
author | Anton Korshunov <anton.korshunov@mongodb.com> | 2022-03-07 13:04:52 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-03-07 13:34:11 +0000 |
commit | 01a53e327026b3cef9f869669c81ca4d6c4ac460 (patch) | |
tree | c352ef7a7f3c7be1f13fb3e01161bc4f40bde227 /src/mongo/db/exec/js_function.h | |
parent | 7e114c6dc901142c721a9ca7c7adc17edd4868e4 (diff) | |
download | mongo-01a53e327026b3cef9f869669c81ca4d6c4ac460.tar.gz |
SERVER-64036 Avoid making a copy of JsFunction when generating an SBE plan
Diffstat (limited to 'src/mongo/db/exec/js_function.h')
-rw-r--r-- | src/mongo/db/exec/js_function.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/mongo/db/exec/js_function.h b/src/mongo/db/exec/js_function.h index 2d7805e698b..55f1343fb39 100644 --- a/src/mongo/db/exec/js_function.h +++ b/src/mongo/db/exec/js_function.h @@ -40,7 +40,7 @@ namespace mongo { */ class JsFunction { public: - JsFunction(OperationContext* opCtx, const std::string& code, const std::string& dbName); + JsFunction(OperationContext* opCtx, std::string code, std::string dbName); JsFunction(const JsFunction& other); JsFunction(JsFunction&& other) = delete; @@ -49,10 +49,18 @@ public: bool runAsPredicate(const BSONObj& obj) const; + const std::string& getCode() const { + return _code; + } + + const std::string& getDbName() const { + return _dbName; + } + size_t getApproximateSize() const; private: - void _init(OperationContext* opCtx, const std::string& code, const std::string& dbName); + void _init(OperationContext* opCtx, std::string code, std::string dbName); std::string _code; std::string _dbName; |